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);
Related
I am using datalist for showing datas. Datas are test questions with 4 options.I have 50 questions displaying in datalist.
By using ItemDataBound event - i am making visible only one question with 4 options to user. Remaining questions are invisible . In the Itemdatabound event - i am assigning id to the radio buttons. but also id is not assigned to the datalist ,it showing different id.
<div class="widget">
<div class="widget-header" align="center" style="background: #4a98c9; color: #FFFFFF;">
<h4>
<asp:Label ID="Label5" runat="server" Text="Question : "></asp:Label>
<asp:Label ID="lblQuestionNo" runat="server" Text="0 of 0"></asp:Label></h4>
<asp:HiddenField ID="HdCurrentQuestSlNo" runat="server" />
<asp:HiddenField ID="HdfMinTime" runat="server" />
<asp:HiddenField ID="HdfSecTime" runat="server" />
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:HiddenField ID="HdfQSlNo" runat="server" />
<asp:HiddenField ID="HdQuestCount" runat="server" Value="0"/>
</div>
<div class="widget-content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="PanelQuestBlock" runat="server" ScrollBars="Vertical" Width="100%" Height="325px">
<asp:DataList runat="server" ID="DataListQuestion"
onitemdatabound="DataListQuestion_ItemDataBound"
onitemcreated="DataListQuestion_ItemCreated">
<ItemTemplate>
<div class="questdisplayId" id="divQuestBlock" runat="server">
<div>
<asp:HiddenField ID='HdSlNo' runat="server" Value='<%# Eval("SlNo") %>' ClientIDMode="Static"/>
<asp:HiddenField ID="HdUserQuestId" runat="server" Value='<%# Eval("UserQuestionId") %>' ClientIDMode="Static"/>
<asp:HiddenField ID="HdTotalOptions" runat="server" Value='<%# Eval("TotalOptions") %>' ClientIDMode="Static"/>
<asp:HiddenField ID="HdQuestAnsweredTimeSecs" runat="server" Value='<%# Eval("AnsweredTimeSecs") %>' ClientIDMode="Static"/>
<asp:HiddenField ID="HdOptionAnswered" runat="server" Value='<%# Eval("OptionAnswered") %>' ClientIDMode="Static"/>
</div>
<div>
<asp:Label ID="Question" runat="server" Text='<%# Eval("Question") %>'></asp:Label>
</div>
<div class="answer-row" id="divOption1" runat="server">
<asp:RadioButton ID="Option1" runat="server" GroupName="Answer" value="1" Text='<%# Eval("Option1") %>'
CssClass="rdbtn" Style="vertical-align: middle" ClientIDMode="Static"/>
<asp:Label ID="lblOpt1" runat="server" Text=""></asp:Label>
</div>
<div class="answer-row" id="divOption2" runat="server">
<asp:RadioButton ID="Option2" runat="server" GroupName="Answer" value="2" Text='<%# Eval("Option2") %>'
CssClass="rdbtn" Style="vertical-align: middle" ClientIDMode="Static"/>
<asp:Label ID="lblOpt2" runat="server" Text=""></asp:Label>
</div>
<div class="answer-row" id="divOption3" runat="server">
<asp:RadioButton ID="Option3" runat="server" GroupName="Answer" value="3" Text='<%# Eval("Option3") %>'
CssClass="rdbtn" Style="vertical-align: top; left: auto;" ClientIDMode="Static"/>
<asp:Label ID="lblOpt3" runat="server" Text=""></asp:Label>
</div>
<div class="answer-row" id="divOption4" runat="server">
<asp:RadioButton ID="Option4" runat="server" GroupName="Answer" value="4" Text='<%# Eval("Option4") %>'
CssClass="rdbtn" Style="vertical-align: text-top" ClientIDMode="Static"/>
<asp:Label ID="lblOpt4" runat="server" Text=""></asp:Label>
</div>
<div class="answer-row" id="divOption5" runat="server">
<asp:RadioButton ID="Option5" runat="server" GroupName="Answer" value="4" Text='<%# Eval("Option5") %>'
CssClass="rdbtn" Style="vertical-align: text-top" ClientIDMode="Static"/>
<asp:Label ID="lblOpt5" runat="server" Text=""></asp:Label>
</div>
</div>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<div class="row">
<div class="span8" align="center">
<asp:Button ID="btnClear" runat="server" Text="Clear Selection"
CssClass="btn btn-warning" OnClientClick="Clearbutton();"
/>
<asp:Button ID="btnSave" runat="server" Text="Save & Next" CssClass="btn btn-success" OnClientClick="Savebutton()"/>
</div>
<div class="span4" align="center">
<asp:Button ID="btnReview" runat="server" Text="Mark Review & Next" CssClass="btn btn-info" OnClientClick="Reviewbutton()"/>
<asp:Button ID="btnFinish" runat="server" Text="Finish" CssClass="btn btn-danger" OnClientClick="Finishbutton()"/>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnReview" />
<asp:AsyncPostBackTrigger ControlID="btnClear" />
<asp:AsyncPostBackTrigger ControlID="btnSave" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DataListQuestion" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
HiddenField HdSlNo = (HiddenField)e.Item.FindControl("HdSlNo");
RadioButton Option1 = (RadioButton)e.Item.FindControl("Option1");
RadioButton Option2 = (RadioButton)e.Item.FindControl("Option2");
RadioButton Option3 = (RadioButton)e.Item.FindControl("Option3");
RadioButton Option4 = (RadioButton)e.Item.FindControl("Option4");
RadioButton Option5 = (RadioButton)e.Item.FindControl("Option5");
Option1.ID = "rdbtnoption1_" + HdSlNo.Value.ToString();
Option2.ID = "rdbtnoption2_" + HdSlNo.Value.ToString();
Option3.ID = "rdbtnoption3_" + HdSlNo.Value.ToString();
Option4.ID = "rdbtnoption4_" + HdSlNo.Value.ToString();
Option5.ID = "rdbtnoption5_" + HdSlNo.Value.ToString();
}
In my design page code , using Datalist i am binding 50 questions . while binding itself i am hiding 2 to 50 questions . Question 1 only visible. I tried to give dynamic id for every questions and options using event databound and rowcreated. First it got error , after that i changed properties as ClientIDMode="Static" for controls.it shown different id. But if i click any button event again it clear the id's.again it shows old ids only.
I am developing ASP.NET application and I have a modal popup dialog with asp:button on it. I was developing my application on Windows 7 x86 platform, and there, click on this button works fine. But when I deploy the exact same code on Windows 7 x64 platform, click on this button inside modal popup doesn't work. Does anybody have idea what am I missing?
This is the Panel that I am showing and ModalPopupExtender that I use to show it.
<asp:ModalPopupExtender runat="server" ID="Extender_ConfirmChange"
PopupControlID="Panel_ConfirmChange"
TargetControlID="HiddenFieldChange"
BackgroundCssClass="modalBackground"
Drag="True"
PopupDragHandleControlID="LegendChange"
OkControlID="BtnYes_ConfirmChange"
CancelControlID="BtnNo_ConfirmChange"
DynamicServicePath="" Enabled="True">
</asp:ModalPopupExtender>
<asp:HiddenField ID="HiddenFieldChange" runat="server" />
<asp:Panel runat="server" ID="Panel_ConfirmChange" Height="100px" Width="400px" style="display: none">
<div id="Div1" runat="server" class="UserData">
<fieldset class='UserPanel'>
<legend id="LegendChange" class="CursorCorrector">
<asp:Label ID="LabelChange" runat="server" meta:resourcekey="ChangeResource"></asp:Label>
</legend>
<asp:Panel runat="server" BackColor="White" >
<asp:Table runat="server">
<asp:TableRow>
<asp:TableCell>
<asp:Image ID="img" ImageUrl="../Images/Shield_Yellow32.png" runat="server"
meta:resourcekey="imageChangeResource" style="padding-right:8px"/>
</asp:TableCell>
<asp:TableCell>
<asp:Label ID="lblChange" runat="server" meta:resourcekey="lblChangeResource" ></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<br />
<br />
<div class="button">
<asp:Button ID="BtnYes_ConfirmChange" runat="server"
OnClick="BtnYes_ConfirmChange_OnClientClick" UseSubmitBehavior="False"
Width="70px" meta:resourcekey="BtnYes_ConfirmChangeResource"/>
<asp:Button ID="BtnNo_ConfirmChange" runat="server" Width="70px"
OnClick="BtnNo_ConfirmChange_OnClientClick"
meta:resourcekey="BtnNo_ConfirmChangeResource"/>
<asp:Button ID="BtnCancel_ConfirmChange" runat="server" Width="70px"
OnClick="BtnCancel_ConfirmChange_OnClientClick"
meta:resourcekey="BtnCancel_ConfirmChangeResource"/>
</div>
</asp:Panel>
</fieldset>
</div>
</asp:Panel>
this is what happens. i don't understand why its not working, because if i copy the code to a normal template everything works fine :S so i dont think its a code issue. im working with asp and c#![enter image description here][1]
http://s21.postimg.org/3jsi8351z/weird.png here is a prints screen i took to explain the issue
Asp:
<asp:panel ID="pnltopico" runat="server" GroupingText="Topico" Height="100px"
Width="550px" Visible="False" Wrap="False">
<asp:DropDownList ID="droptopico" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource1" DataTextField="nome" DataValueField="Id_topico"
Height="22px"
onselectedindexchanged="DroptopicoSelectedIndexCha nged" Width="169px">
</asp:DropDownList>
<asp:panel ID="pnlpermissoestopico" runat="server" GroupingText="Permissões"
Height="59px" style="margin-top: 0px" Width="354px" Wrap="False"
ClientIDMode="inherit">
<asp:ListBox ID="lbpermitidotp" runat="server"
EnableViewState="true" Height="80px"
></asp:ListBox>
<asp:Button ID="btnproibirtp" runat="server" onclick="BtnpermitirClick"
Text=">>" />
<asp:Button ID="btnpermitirtp" runat="server" onclick="BtnnaopermitirClick"
Text="<<" Height="26px" />
<asp:ListBox ID="lbproibidotp" runat="server"
EnableTheming="False" EnableViewState="true" Height="80px" onselectedindexchanged="lbproibidotp_SelectedIndex Changed"
></asp:ListBox> </asp:panel>
since the code is working fine i dont think i need to post the c# code but let me know if it could help.
thanks for your help
Hey I just Modified your code a little and Compiled it everything is working fine now:
<asp:panel ID="pnltopico" runat="server" GroupingText="Topico" Height="100px"
Width="550px" Visible="False" Wrap="False">
<asp:DropDownList ID="droptopico" runat="server" AutoPostBack="True"
DataTextField="nome" DataValueField="Id_topico"
Height="22px"
onselectedindexchanged="droptopico_SelectedIndexChanged" Width="169px">
</asp:DropDownList>
</asp:panel>
<asp:panel ID="pnlpermissoestopico" runat="server" GroupingText="Permissões"
Height="59px" style="margin-top: 0px" Width="354px" Wrap="False"
ClientIDMode="inherit">
<asp:ListBox ID="lbpermitidotp" runat="server"
EnableViewState="true" Height="80px"
>
<asp:ListItem Text="Admin" Value="Admin" />
<asp:ListItem Text="Guest" Value="Guest" />
</asp:ListBox>
<asp:Button ID="btnproibirtp" runat="server" OnClick="btnproibirtp_Click"
Text=">>" />
<asp:Button ID="btnpermitirtp" runat="server"
Text="<<" Height="26px" />
<asp:ListBox ID="lbproibidotp" runat="server" EnableTheming="False" EnableViewState="true" Height="80px">
<asp:ListItem Text="Moderator" Value="Moderator" />
<asp:ListItem Text="Utilizer" Value="Utilizer" />
</asp:ListBox> </asp:panel>
and I have put the breakpoint on the Button Click of the btnproibirtp , just to verify and it works normally ,
I think u had some tags formation error or so :
protected void btnproibirtp_Click(object sender, EventArgs e)
{
string lbl1 = lbproibidotp.SelectedValue;
}
regards
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;
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.