ASP.NET Panel Not Ending - asp.net

I have created an ASP.NET page with an AJAX Accordion control. Within on the panes are several controls, some of which I've placed inside a Panel control, for various reasons.
However, controls which are on the page AFTER the closing tag for the panel are appearing INSIDE the panel when the page is rendered. For the life me I can't figure out why, and it's driving me crazy! Even clicking on the header of the Accordion Pane after the one containing the panel doesn't cause the Pane to expand, which it did before I added the Panel, seemingly because even IT is behaving as if it's within the Panel!
Any ideas what I'm doing wrong? How can I make the page believe that the panel ends!!?
<asp:Accordion ID="accQuestionnaire" runat="server" RequireOpenedPane="false" ContentCssClass="AccordionContent" HeaderCssClass="AccordionHeader" FadeTransitions="true"
transitionduration="250" HeaderSelectedCssClass="AccordionSelected" SelectedIndex="0" SuppressHeaderPostbacks="true" >
<Panes>
<%--START OF Tristan Link Pane (0)-------------------------------------------------------------%>
<asp:AccordionPane ID="pnTristanLink" runat="server" ContentCssClass="AccordionContent" ViewStateMode="Enabled" >
<Header>
Tristan Link
</Header>
<Content>
<div class="centrebuttonsdiv" >
<asp:Button ID="btnSearchTristan" runat="server" CssClass="largebutton" Text="Search Tristan" /><br />
</div>
<asp:Panel ID="pnlTristanSearch" runat="server" CssClass="panel" >
<div class="leftdiv"> <%--Matching Tristan results--%>
<asp:FormView ID="fvTristanSearch" runat="server" CssClass="FormView" >
<ItemTemplate>
<asp:Label ID="lblTristanSearchLabel" runat="server" CssClass="fieldtitle" Text="The information from Tristan for this Case Number is:" /><br /><br />
<asp:Label ID="lblAnimalNameLabel" runat="server" CssClass="fieldtitle" Text="Horse Name: " />
<asp:Label ID="lblAnimalName" runat="server" Text='<%# Eval("PetName") & " " & Eval("ClientNameLast") %>' /><br />
<asp:Label ID="lblGenderLabel" runat="server" CssClass="fieldtitle" Text="Sex: " />
<asp:Label ID="lblGender" runat="server" Text='<%# Eval("L_GenderDesc") %>' /><br />
<asp:Label ID="lblBreedLabel" runat="server" CssClass="fieldtitle" Text="Breed: " />
<asp:Label ID="lblBreed" runat="server" Text='<%# Eval("L_BreedDesc") %>' /><br />
<asp:Label ID="lblDOBLabel" runat="server" CssClass="fieldtitle" Text="DOB: " />
<asp:Label ID="lblDOB" runat="server" Text='<%# Eval("PetDOB", "{0:d}") %>' /><br /><br />
</ItemTemplate>
</asp:FormView>
</div>
<div class="rightdiv">
<br /><br />
<asp:Label ID="lblUnmatchedAppointments" runat="server" Text="Appointments for this horse with no Colic Study details:" Visible="false" /><br />
<asp:ListBox ID="lstUnmatchedAppointments" runat="server" DataSourceID="SQLUnmatchedAppointments" DataTextField="AppointmentDate" DataTextFormatString="{0:d}" DataValueField="AppointmentID"
Visible = "False" />
</div>
<div class="cleardiv" />
</asp:Panel>
<div class="centrebuttonsdiv" >
<asp:Label ID="lblTristanSearchInstructions" runat="server" Text="Select an appointment from the list above and click 'Save Section' to continue. Otherwise, click 'Clear Retrieved Information'
to search again" Visible="false" /><br />
<asp:Button ID="btnClearTristanSearch" runat="server" Text="Clear Retrieved Information" Visible="false" CssClass="largebutton" />
<asp:Button ID="btnSaveTristanLink" runat="server" Text="Save Section" OnClientClick="disablePanes()" Visible="false" Enabled="false" CssClass="largebutton" />
</div>
</Content>
</asp:AccordionPane>

I believe that changing this line:
<div class="cleardiv" />
to this
<div class="cleardiv"></div>
will solve that rendering problem; <div> is not typically a self-closing tag.

Related

modal popup extender is not working in visual studio 2013 for web

I am encountering this issue:
asp.net ajax client-side framework failed to load
when I tried to open the modal popup-blocker.
How can I solve this? I've been struggling for weeks...
Here's the code for the same:
<form id="form1" runat="server">
<cc:ToolkitScriptManager ID="sc1" runat="server"></cc:ToolkitScriptManager>
<div>
<asp:Button ID="ModalCall" runat="server" OnClick="ModalCall_Click" Text="ModalCall" />
<cc:ModalPopupExtender ID="mod1" runat="server" CancelControlID="btn1" PopupControlID="pan1" TargetControlID="ModalCall"></cc:ModalPopupExtender>
<asp:Panel ID="pan1" runat="server">
<asp:Button ID="Register" runat="server" OnClick="Register_Click" Text="Register" />
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<asp:TextBox ID="Password" runat="server"></asp:TextBox>
<asp:TextBox ID="ConfirmPassword" runat="server"></asp:TextBox>
<br />
<asp:Button ID="Login" runat="server" OnClick="Login_Click" Text="Login" />
<asp:TextBox ID="LoginEmail" runat="server"></asp:TextBox>
<asp:TextBox ID="LoginPassword" runat="server"></asp:TextBox>
<br />
<asp:Button ID="CallService" runat="server" OnClick="CallService_Click" Text="Call Service" />
<br />
<asp:Button ID="ChangePassword" runat="server" OnClick="ChangePassword_Click" Text="ChangePassword" />
<asp:TextBox ID="OldPassword" runat="server"></asp:TextBox>
<asp:TextBox ID="NewPassword" runat="server"></asp:TextBox>
<asp:TextBox ID="ConfirmChangedPassword" runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="btn1" runat="server" Text="hide" />
</asp:Panel>
</div>
</form>

Finding the datakey of a nested listview control

I have a listview control that is bounded by an entity query. The main listview is bounded to the entity called Article. The second listview(nested one) is bounded to an icollection of Article_Comment. I am trying to get the ID of a article so that I can use it in updating the article comment table. Below is what I have so far.
<asp:ListView ID="listComment" runat="server" DataKeyNames="ArticleID" >
<LayoutTemplate>
<div class="row">
<h3>Comments</h3>
<blockquote>
<asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
</blockquote>
</div>
</LayoutTemplate>
<ItemSeparatorTemplate>
<hr />
</ItemSeparatorTemplate>
<ItemTemplate>
<h4 class="text-error"><%#Eval("Title")%></h4>
<br />
<h4 class="text-error"><%#Eval("ArticleID")%></h4
<br />
<p><%#Eval("ArticleContent")%> </p>
<asp:ListView ID="list" runat="server" DataSource='<%# Eval("Article_CommentTable")%>'
InsertItemPosition="LastItem" OnItemCommand="list_ItemCommand" OnItemDataBound="list_ItemDataBound"
DataKeyNames="ArticleID" OnItemInserting="list_ItemInserting">
<LayoutTemplate>
<div class="row">
<h3>Comments</h3>
<asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
</div>
</LayoutTemplate>
<ItemTemplate>
<p>
Username : <%#Eval("UserName")%>
<br />
Comments : <%#Eval("Comment")%>
<br />
<%--<asp:Label ID="lblID" runat="server" Text='<%# Bind("ArticleID")%>'></asp:Label>--%>
<asp:HiddenField ID="hid" runat="server" Value='<%# Bind("ArticleID")%>' />
</p>
</ItemTemplate>
<InsertItemTemplate>
<div class="row" runat="server">
<asp:TextBox ID="txtUserName" runat="server" CssClass="form-control" />
<br />
<asp:TextBox ID="txtComment" runat="server" CssClass="form-control" />
<FCKeditorV2:FCKeditor ID="editorArticle" runat="server"
BasePath="~/FCKeditor/" Height="200px" Width="400px"
Value="Start typing here" ToolbarStartExpanded="False">
</FCKeditorV2:FCKeditor>
<br />
<asp:Button ID="btnAddComment" runat="server" CssClass="btn btn-info"
CommandName="insert" Text="Join The Discussion" CommandArgument='<%#Eval("ArticleID")%>' />
</div>
</InsertItemTemplate>
</asp:ListView>
</ItemTemplate>
</asp:ListView>
I am trying to access the ArticleID for each row that a button is clicked. How should I do that?
you can get it in ItemCommand event as listComment.DataKeys[dataItem.DisplayIndex].Value

Why ImageButton Display Text SubmitQuery Runtime

i use imagebutton in datalist and set codeexpression :Eval("PictureUrl", "ProductImages\thumb_{0}") and runtime display submitquery.
<asp:DataList ID="DataList1" runat="server" DataKeyField="pid"
DataSourceID="SqlDataSource1">
<ItemTemplate>
pname:
<asp:Label ID="pnameLabel" runat="server" Text='<%# Eval("pname") %>' />
<br />
pprice:
<asp:Label ID="ppriceLabel" runat="server" Text='<%# Eval("pprice") %>' />
<br />
publisher:
<asp:Label ID="publisherLabel" runat="server" Text='<%# Eval("publisher") %>' />
<br />
writer:
<asp:Label ID="writerLabel" runat="server" Text='<%# Eval("writer") %>' />
<br />
<asp:ImageButton ID="ImageButton7" runat="server"
ImageUrl='<%# Eval("PictureUrl", "ProductImages\thumb_{0}") %>' />
<br />
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:dbpath %>"
SelectCommand="SELECT [pname], [pprice], [PictureUrl], [gid], [storeid], [publisher], [writer], [pid] FROM [tblproduct]">
</asp:SqlDataSource>
output one record:
pname:
<span id="ContentPlaceHolder1_DataList1_pnameLabel_0">تکنیک عکاسی</span>
<br />
pprice:
<span id="ContentPlaceHolder1_DataList1_ppriceLabel_0">125000 </span>
<br />
publisher:
<span id="ContentPlaceHolder1_DataList1_publisherLabel_0">اسرار دانش</span>
<br />
writer:
<span id="ContentPlaceHolder1_DataList1_writerLabel_0">نصرالله کسرائیان</span>
<br />
<input type="image" name="ctl00$ContentPlaceHolder1$DataList1$ctl00$ImageButton7" id="ContentPlaceHolder1_DataList1_ImageButton7_0" src="ProductImages%09humb_~/image/tecnikakasi.jpg" />
You got the correct HTML rendered
<asp:ImageButton ID="ImageButton7" runat="server"
ImageUrl='<%# Eval("PictureUrl", "ProductImages\thumb_{0}") %>' />
will produce input tag with type=image
<input type="image" name="ctl00$ContentPlaceHolder1$DataList1$ctl00$ImageButton7" id="ContentPlaceHolder1_DataList1_ImageButton7_0" src="ProductImages%09humb_~/image/tecnikakasi.jpg" />
The problem is ProductImages%09humb_~/image/tecnikakasi.jpg not exists. It may be wrong.
Check the relative path rendered.
Try
ImageUrl='<%# Eval("PictureUrl", "~/ProductImages/thumb_{0}") %>'
It is displaying "SubmitQuery" because your image is not being loaded. If your writer alternate text, then alternate text will be displayed.
You can view source of the generated html and check the path of the image and try to correct it for resolving this problem.
ImageUrl='<%# Eval("PictureUrl", "{0}") %>'

asp.net ModalPopupExtender not behaving properly

I have the following code on a .aspx file. If I comment out the ModalPopupExtender code works fine.:
<cc1:ModalPopupExtender BehaviorID="mdlPopup" runat="server" TargetControlID="btn"
ID="mdl1" PopupControlID="pnlPopup" OkControlID="LinkButton1" BackgroundCssClass="modalBackground" />
<asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" Style="display: none;">
<div class="inner">
Work Order #: <asp:TextBox ID="txtWorkOrder" runat="server" Width="285" Text=""></asp:TextBox><br /><br />
Please Enter Corrective Actions<br />
<asp:TextBox ID="TextBox2" runat="server" Height="150" Width="285" TextMode="MultiLine"
Text=""></asp:TextBox>
<asp:Button ID="btnOK" runat="server" Font-Bold="true" Text="Submit" OnClick="click"
Width="150" />
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClick="cancel" />
</div>
</asp:Panel>
<asp:Button ID="btn" runat="server" Style="display: none;" />
<asp:Label ID="id" runat="server" Text="Label" Visible="false"></asp:Label>
The problem that I am having is that the page just hangs when I have this code in the .aspx file. Is there anything I should do. It does not even get to the Page_Load.
I am calling this page that has the above code with the following:
string url = "Alerts.aspx?";
url += "ID=" + id.Text;
Response.Redirect(url);

Aligning .aspx buttons

I have an update panel that contains a label, a dropDownList and two buttons:
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dropDownList" style="position:relative;" runat="server">
<label>
Select New File: </label>
<div id="ddl" runat="server">
<asp:DropDownList runat="server" ID="ddlCaseFiles" DataSourceID="dsMyCaseFiles" DataTextField="Display"
DataValueField="FileID" OnPreRender="ddl_PreRender" Width="524px" OnSelectedIndexChanged="ddlCaseFiles_SelectedIndexChanged" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCaseFiles"
ToolTip="Casefile Required" InitialValue="-1" Text="*" Display="Dynamic" />
<ajaxToolkit:ListSearchExtender ID="ddlExtCaseFiles" runat="server" PromptCssClass="ListSearchExtenderPrompt"
TargetControlID="ddlCaseFiles" BehaviorID="ddlExtCaseFiles" Enabled="True" />
</div>
<br />
<asp:Button ID="btnMoveCaseFile" runat="server" Text=""
style="float:left;" onclick="btnMoveCaseFile_Click"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel"
style="float:right" onclick="btnCancel_Click"/>
<br />
</div>
<asp:Label runat="server" ID="lblStatus"></asp:Label>
</ContentTemplate>
I am trying to get my buttons to line up like this:(button at the beginning of the DropDownList and a button at the End)
I've tried float-absolute etc.
I figured it out. Seems as though you have to add in px after the number.....
<asp:Button ID="btnMoveCaseFile" runat="server" Text=""
style="position:absolute; float:left; margin-left:104px;" onclick="btnMoveCaseFile_Click"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel"
style="position:relative; float:right; margin-right:63px;"
since I had margin-right:63; instead of margin-right:63px;

Resources