Asp.Net tab control not visible - asp.net

Problem is simple the tab control shows in design mode but is not getting shown when viewing from browser. Enable and Visible is true. Although the controls are getting rendered and I can see the HTML.
I am using .NET 3.5 AND TOOLKIT version is 3.5.4xxxx
Page code is like this. Right now ther is nothing in the code behind.
<%# Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.Master" CodeFile="OrderDetailsPage.aspx.cs" Inherits="OrderDetailsPage" Title="Order Page" EnableViewState="true" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div id="pagetitle">
<asp:Literal ID="caseHeader" runat="server">Loyalty Management Partner Portal</asp:Literal>
</div>
<!--CONTENT CONTAINER-->
<div id="content-container-two-column">
<!--CONTENT SIDE 1 COLUMN-->
<div id="content-side-two-column" height="780px">
<ul class="list-of-links">
<li>Loyalty Management</li>
<li>Orders Status Page</li>
</ul>
<br />
</div>
<!--CENTER COLUMN-->
<div id="content-main-two-column">
<strong class="headerText">Order Details Page</strong>
<br />
<br />
<h3 class="helpText">
Provide details of Order. You can update order status, Add notes to orders.
</h3>
<asp:Label ID="lblError" CssClass="error" ForeColor="Red" runat="server" />
<hr />
<asp:TabContainer ID="tabContainer1" runat="server" Width="100%" Height="250px">
<asp:TabPanel runat="server" ID="tabOrder" HeaderText="Order">
<ContentTemplate>
<table width="100%">
<tr>
<td valign="top" width="15%">
<b>Order No.</b>
</td>
<td width="85%" colspan="4" valign="top">
<asp:Label ID="lblOrderNo" runat="server"></asp:Label>
</td>
</tr>
<tr>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="tabOrderDetails" runat="server" HeaderText="Ordered Items">
<ContentTemplate>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="tabNotes" runat="server" HeaderText="Notes">
<ContentTemplate>
<table width="100%">
<tr>
<td></td>
<td></td>
</tr>
</table>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</div>
<div class="clear">
</div>
</div>
</asp:Content>

I uninstalled the Ajax toolkit and reinstall it to make it working.

Related

How to migrate from ASP.NET to ASP.NET Core

<%# Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Feedback.aspx.cs" Inherits="Feedbackajax" Title="Star Bus: Feedback" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content1" runat="Server">
<div id="innertitle">
<table align="center" style="margin-bottom:25px">
<tr align="left">
<td align="left">
<strong>
<asp:Label ID="lblheat" runat="server" Text="Feedback" Font-Size="X-Large" ForeColor="#F7990D"></asp:Label>
</strong>
<br />
</td>
</tr>
</table>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div id="rightContent">
<div class="mainText" id="maintextBox">
<!-- Body Content Starts -->
<div id="formBody" style="margin:0 auto;text-align:center">
<table cellspacing="3" cellpadding="0" border="0" align="center" style="text-align:left">
<tbody>
<tr>
<td height="30">
<strong><span>Name: </span></strong>
</td>
<td valign="middle">
<asp:TextBox ID="txtname" runat="server" />
<asp:RequiredFieldValidator ID="rfvnaem" ErrorMessage="*" ControlToValidate="txtname"
runat="server" />
</td>
</tr>
<tr>
<td height="30">
<strong><span>Email:</span></strong>
</td>
<td valign="middle">
<asp:TextBox ID="txtemail" runat="server" />
<asp:RequiredFieldValidator ID="rfvemail" ErrorMessage="*" ControlToValidate="txtemail"
runat="server" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Enter the Vaild Email ID"
ControlToValidate="txtemail" ValidationExpression="\w+([-+.']\w+)*\w+([-.]\w+)*\.\w+([-.]\w+)*" />
</td>
</tr>
<tr>
<td height="30">
<strong><span>Phone:</span></strong>
</td>
<td valign="middle">
<asp:TextBox ID="txtph" runat="server" />
<asp:RangeValidator ID="rangeph" ControlToValidate="txtph" Text="Invalid Phone" Type="Double"
MinimumValue="1" MaximumValue="9999999999" runat="server" />
</td>
</tr>
<tr>
<td height="30">
<strong><span>Subject:</span></strong>
</td>
<td valign="middle">
<div id="txtHint">
<asp:DropDownList CssClass="form" tyle="width: 130px" ID="dlsubject" runat="server"
Width="133px">
<asp:ListItem Text="Bus service" Value="Bus service"></asp:ListItem>
<asp:ListItem Text="website" Value="website"></asp:ListItem>
<asp:ListItem Text="schedules" Value="schedules"></asp:ListItem>
<asp:ListItem Text="Other" Value="Other"></asp:ListItem>
</asp:DropDownList>
</div>
</td>
</tr>
<tr>
<td>
<strong><span style="vertical-align:middle">Comment:</span></strong><br />(Max 1000 char)
</td>
<td class="style1">
<asp:TextBox ID="txtcomment" runat="server" MaxLength="1000" TextMode="MultiLine"
Height="75px" Width="235px" />
<asp:RequiredFieldValidator ID="rfvcomment" ErrorMessage="*" ControlToValidate="txtcomment"
runat="server" />
</td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<asp:Button ID="btnsubmit" runat="server" Text="Submit" OnClick="btnsubmit_Click" />
</td>
</tr>
</tbody>
</table>
</div>
<!-- Body Content Ends -->
</div>
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceHolder4" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
</asp:Content>
This is my ASP.NET project that I have already created. But now I have the need to convert this project to ASP.NET Core 2.1 or later.
I am finding it difficult to do it as there is a lot that has changed.
I would like to get the assistance of the expertise on how I could do it please.
My greatest problem is not knowing how to replace certain place holders and tag helpers to the newer version.
Regards

Moving page from Updatepanel to AccordianPane 'hides' previously visible property

I'm trying to move a page from an AJAX UpdatePanel to an Ajax Control Toolkit AccordianPane. When I run the app I get the following error :
DataBinding: 'AjaxControlToolkit.AccordionContentPanel' does not
contain a property with the name 'IsNdmaVisible'.
Here is a code snippet from the page I'm embedding in the AccordianPaneControl, with the property IsNdmaVisible in question, as referred to in the DataBinder.Eval method:
<%# Control Language="C#" AutoEventWireup="true" CodeBehind="ScenarioEditor.ascx.cs"
Inherits="Clients.Views.Controls.ScenarioEditor" %>
<%# Register Src="~/SharedUserControls/AjaxMonthCalendar.ascx" TagName="AjaxMonthCalendar" TagPrefix="ajaxMonthCalendar" %>
<%# Register Src="~/SharedUserControls/AjaxFcdMonthCalendar.ascx" TagName="AjaxFcdMonthCalendar" TagPrefix="ajaxMonthCalendar" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:UpdatePanel ID="m_ScenarioEditorUpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="m_ScenarioEditorPanel" runat="server" meta:resourcekey="m_ScenarioEditorPanelResource1">
<table class="layout-table input-strech">
<tr>
<td colspan="4">
<table class="layout-table" >
<tr>
<td>
<asp:CheckBox ID="m_SnowBallCheckBox" ValidationGroup="ScenarioStrategies" runat="server"
Width="100px" meta:resourcekey="m_SnowBallCheckBox" />
</td>
<td>
<asp:CheckBox ID="m_NDMACheckBox" ValidationGroup="ScenarioStrategies" runat="server"
Width="100px" **Visible='<%# (bool)DataBinder.Eval(Container, "IsNdmaVisible") %>'**
Enabled='<%# (bool)DataBinder.Eval(Container, "IsNdmaEnabled") %>' meta:resourcekey="m_NDMACheckBox" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
</asp:Panel>
<div id="flag">
</div>
<asp:Literal ID="StartUpScript" runat="server" Visible="false">
<script language="javascript" type="text/javascript">
ScenarioEditor.StartUp();
</script>
</asp:Literal>
</ContentTemplate>
</asp:UpdatePanel>
Inasmuch embedding the above ScenarioEditor.ascx page, here with the original code snippet which works perfectly, followed by my new code, which obviously breaks (I'm including the assembly and code references only once for both snippets):
Reference and 'exteral' code registering:
<%# Page Title="" Language="C#" MasterPageFile="~/Shared/CareMaster.Master" AutoEventWireup="true" CodeBehind="EditScenario.aspx.cs" Inherits="Clients.Views.EditScenario" meta:resourcekey="PageResource1" %>
<%# Register Src="~/Clients/Controls/ScenarioEditor.ascx" TagName="ScenarioEditor" TagPrefix="clientControls" %>
<%# Register Src="~/SharedUserControls/CollapsibleContentPanel.ascx" TagName="CollapsibleContentPanel" TagPrefix="sharedControls" %>
<%# Register src="~/SharedUserControls/AjaxCalendar.ascx" tagname="AjaxCalendar" tagprefix="ajaxCalendar" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
Working Code:
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
<sharedControls:CollapsibleContentPanel ID="m_ScenarioEditorPanel" runat="server" style="margin-bottom: 1em">
<Title>
Scenario Details
</Title>
<Content>
<div >
<asp:HiddenField ID="labelForRadio" Value="" runat="server"/>
</div>
<asp:UpdatePanel ID="ButtonsPanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="float:left;">
<clientControls:ScenarioEditor runat="server" ID="m_ScenarioEditor" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</Content>
</sharedControls:CollapsibleContentPanel>
</asp:Content>
My code:
<ajaxToolkit:Accordion ID="Accordian1" runat="server">
<Panes>
<ajaxToolkit:AccordionPane ID="ScenarioDetails" runat="server">
<Header>Scenario Details</Header>
<Content>
<asp:UpdatePanel ID="ButtonsPanel" runat="server" BackColor="Yellow">
<ContentTemplate>
<div style="float:left;">
<clientControls:ScenarioEditor runat="server" ID="m_ScenarioEditor" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</Content>
</ajaxToolkit:AccordionPane>
</Panes>
</ajaxToolkit:Accordion>

Why TabContainer doesnot show?

I had my TabContainer but when I run the TabContainer didn't display .
<asp:TabContainer ID="TC_Article" runat="server" ActiveTabIndex="0" Width="100%"
Visible="true">
<asp:TabPanel ID="Add" runat="server">
<HeaderTemplate>
Add New</HeaderTemplate>
<ContentTemplate>
<div class="gridpading" id="div" runat="server">
<table border="0" cellspacing="0" style="border-style: solid; border-width: 1px;"
runat="server" visible="False">
<tr id="tr_body" runat="server" visible="False">
<td align="left" width="150px" class="CDtxt" runat="server">
<asp:Label ID="lbl_Body" runat="server" Text="Article_Body"></asp:Label>
</td>
<td align="left" class="CDtxt" runat="server">
<table>
<tr>
<td valign="top">
<cc1:Editor ID="Ed_Body" runat="server" Height="340px" Width="100%" />
</td>
</tr>
</table>
</td>
<td style="width: 194px" runat="server">
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
I added the Register
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
TagPrefix="cc1" %>
There is problem in Register tag in Namespace and also add script manager in page. Try this.
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

Web Form off of Master not working

I'm new to ASP.NET and seems I screwed up my Web Form page that is based off of a Master.
It seems I mixed some invalid html codes but can't figure out why.
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Clips.aspx.cs" Inherits="Clip.Clips" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:EntityDataSource ID="entityDataSource" runat="server" ConnectionString="name=ClipEnt" DefaultContainerName="ClipEnt" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Clips" EntityTypeFilter="Clip" OnSelecting="EntityDataSource_Selecting">
</asp:EntityDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="entityDataSource">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
</Columns>
</asp:GridView>
<div>
<h1>Sending Email</h1>
<table>
<tr>
<td>From:</td>
<td>
<asp:TextBox ID="txtFrom" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>From EMail:</td>
<td>
<asp:TextBox ID="txtFromEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To:</td>
<td>
<asp:TextBox ID="txtTo" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To Email:</td>
<td>
<asp:TextBox ID="txtToEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Subject:</td>
<td>
<asp:TextBox ID="txtSubject" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Message:</td>
<td>
<asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Height="138px"
Width="467px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Button ID="btnSend" runat="server" Text="Send Email"
onclick="btnSend_Click" />
</td>
</tr>
</table>
<asp:Label ID="Label1" runat="server" ForeColor="Blue" />
</div>
</form>
</body>
</html>
</asp:Content>
In the masterpage you have something like this:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
You only need to have this stripped markup in the content page. Notice that I have removed DOCTYPE, <html>, <head>, <body> and <form> tags from content page - they will be rendered from Site.Master master page.
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Clips.aspx.cs" Inherits="Clip.Clips" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:EntityDataSource ID="entityDataSource" runat="server" ConnectionString="name=ClipEnt" DefaultContainerName="ClipEnt" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Clips" EntityTypeFilter="Clip" OnSelecting="EntityDataSource_Selecting">
</asp:EntityDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="entityDataSource">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
</Columns>
</asp:GridView>
<div>
<h1>Sending Email</h1>
<table>
<tr>
<td>From:</td>
<td>
<asp:TextBox ID="txtFrom" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>From EMail:</td>
<td>
<asp:TextBox ID="txtFromEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To:</td>
<td>
<asp:TextBox ID="txtTo" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>To Email:</td>
<td>
<asp:TextBox ID="txtToEmail" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Subject:</td>
<td>
<asp:TextBox ID="txtSubject" runat="server" Width="250px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Message:</td>
<td>
<asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Height="138px"
Width="467px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Button ID="btnSend" runat="server" Text="Send Email"
OnClick="btnSend_Click" />
</td>
</tr>
</table>
<asp:Label ID="Label1" runat="server" ForeColor="Blue" />
</div>
</asp:Content>
Some points to remember when developing an asp.net web site -
asp.net web forms can contain only one form tag with the attribute runat='server'. So, when a web form inherits from a masterpage, it inherits the form tag from the master page. therefore, no need to add a form tag separately to the web form.
Common parts of the page should be placed in the master page, where as changing parts should be placed in the web forms that inherit the master page. Site headers and footers are static to every page. so they should be placed on the master page. contents of the web site changes from page to page. so they should be placed on the web forms that inherit the master page.
Links to common resources, i.e. site style sheets and javascript files should also be placed once in the masterpage. web forms that inherit the masterpage will automatically inherit them.
these are some of the things by following which you can easily develop web forms with master pages.

Multiple Ajax Collapsers in one page causes on to close

Ok so currently I have a ajax collapser for "advance search" options. Then I went to add a top bar for navigation which user can show/hide using ajax collapser aswell. By default that collapser is open and the search is closed. Now when i go to click to open the search options it closes the navigation panel.. I can't seem to figure out why it's doing that...Any help is more than appreciated.
<asp:UpdatePanel ID="upNorth" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlNavigation" runat="server" Width="100%">
<div style="float:left;">
<asp:Menu ID="NavOptions" CssClass="toolbar" runat="server" Orientation="Horizontal"
</asp:Menu>
</div>
<div style="float:right; margin-right:20px;">
<asp:Menu ID="NavActions" CssClass="toolbar" runat="server" Orientation="Horizontal"
</asp:Menu>
</div>
</asp:Panel>
<div id="CollapseBar" runat="server" class="bar"><asp:Image ID="iBar" runat="server" ImageUrl="../img/bar.jpg" /></div>
<ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="Server"
TargetControlID="pnlNavigation"
CollapsedSize="0"
Collapsed="false"
ExpandControlID="iBar"
CollapseControlID="iBar"
AutoCollapse="False"
AutoExpand="False"
SuppressPostBack="true"
ScrollContents="false"
ExpandDirection="Vertical"></ajaxToolkit:CollapsiblePanelExtender>
</ContentTemplate>
</asp:UpdatePanel>
<div id="content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers></Triggers>
<ContentTemplate>
<table>
<tr>
<td><asp:TextBox ID="txtSearch" runat="server" /></td>
<td><asp:Button ID="btnSearch" runat="server" Text="Buscar" CssClass="buttons" /></td>
</tr>
</table>
<asp:LinkButton ID="lbShowBusqueda" runat="server" Text="Advanced Options" />
<asp:Image ID="imgCollapse" runat="server" ImageUrl="../img/down.png" />
<asp:Panel ID="Panel1" runat="server">
<table>
<tr>
<td>Name</td>
<td><asp:TextBox ID="txtName" runat="server" /></td>
<td>Lastname</td>
<td><asp:TextBox ID="txtLastName" runat="server" /></td>
</tr>
</table>
</asp:Panel>
<ajaxToolkit:CollapsiblePanelExtender ID="cpe" runat="Server"
TargetControlID="Panel1"
CollapsedSize="0"
Collapsed="True"
ExpandControlID="lbShowBusqueda"
CollapseControlID="lbShowBusqueda"
AutoCollapse="False"
AutoExpand="False"
ImageControlID="imgCollapse"
ExpandedImage="../img/up.png"
CollapsedImage="../img/down.png"
ExpandDirection="Vertical"></ajaxToolkit:CollapsiblePanelExtender>
</ContentTemplate>
</asp:UpdatePanel>
never mind it seems I had to specify expandsize so it stays open...weird but it works..

Resources