在本地工作正常,但当我在肝脏服务器上做注册时,一些时间注册重定向到成功的页面,一些时间没有重定向,也没有得到任何错误信息。注册表非常大,所以,我不会把所有的设计,代码,但我已经从每个区块的代码。根据我的面板的问题可能是,但另一件事,我必须观察如果页面没有注册,然后我重新加载相同的页面,然后填写所有细节,然后它采取提交。
页面加载代码:
BusinessLogic bl = new BusinessLogic();
BusinessObject bo = new BusinessObject();
protected void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("MasterpageID");
body.Attributes.Add("class", "fifth");
//to restore password field when page refreshes
txt_Password.Attributes.Add("value", txt_Password.Text);
}
设计规范:
Nationality:<asp:DropDownList ID="ddl_Nationality" runat="server" CssClass="dropdown" AppendDataBoundItems="true"
AutoPostBack="true" OnSelectedIndexChanged="ddl_Nationality_SelectedIndexChanged">
<asp:ListItem Text="Select" Value="0"></asp:ListItem>
<asp:ListItem Text="Indian" Value="Indian"></asp:ListItem>
<asp:ListItem Text="Expatriate" Value="Expatriate"></asp:ListItem>
</asp:DropDownList>
Title: <asp:DropDownList ID="ddl_Title" runat="server" CssClass="dropdown" AppendDataBoundItems="true">
<asp:ListItem Text="Select" Value="0"></asp:ListItem>
<asp:ListItem Text="Mr." Value="Mr."></asp:ListItem>
</asp:DropDownList>
Name: <asp:TextBox ID="txt_Name" runat="server" CssClass="textfield_new1" MaxLength="20"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
Country: <asp:DropDownList ID="ddl_Country" runat="server" CssClass="dropdown">
<asp:ListItem Text="Select" Value="0"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<table>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel5" runat="server" >
<ContentTemplate>
Total Experience: <asp:DropDownList ID="ddl_years" runat="server" AutoPostBack="true" CssClass="Exp"
OnSelectedIndexChanged="ddl_years_SelectedIndexChanged">
<asp:ListItem Value="0">Year</asp:ListItem>
<asp:ListItem Value="1">0</asp:ListItem>
<asp:ListItem Value="2">1</asp:ListItem>
<asp:ListItem Value="3">2</asp:ListItem>
<asp:ListItem Value="4">3</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="ddl_months" runat="server" CssClass="Exp"
Enabled="false">
<asp:ListItem Selected="True" Value="0">Month</asp:ListItem>
<asp:ListItem Value="1">0</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td> </tr>
</table>
<table>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<cc1:CaptchaControl ID="CaptchaControl1" runat="server" CaptchaBackgroundNoise="None"
CaptchaHeight="40" CaptchaLength="5" CaptchaLineNoise="None" CaptchaMaxTimeout="240"
CaptchaMinTimeout="5" FontColor="111, 109, 85" Width="325px" CaptchaWidth="300"
CssClass="textarea_captha" />
</ContentTemplate>
</asp:UpdatePanel>
</td></tr>
<tr><td>
Enter Text as you See:<asp:TextBox ID="txtCaptcha" runat="server" CssClass="textfield_new1"></asp:TextBox>
</td></tr>
</table>
<table>
<tr><td>
<asp:LinkButton ID="imgbtn_Submit" runat="server" ValidationGroup="reg" CssClass="submitbtn"
</td></tr>
</table>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/spacer.gif" />
<cc1:ModalPopupExtender ID="ModalPopupExtender1" TargetControlID="ImageButton1" PopupControlID="Pnl_popup1"
BackgroundCssClass="modalBackground" Drag="true" PopupDragHandleControlID="Pnl_popup1"
runat="server">
</cc1:ModalPopupExtender>
<asp:Panel ID="Pnl_popup1" runat="server">
//pop design code is here
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
提前谢谢。
发布于 2015-10-21 05:42:35
你的更新面板在重定向中产生了问题。请注意,更新面板仅用于AJAX请求。它将只发布选定的面板数据。因此,当您想要从一个页面重定向到另一个页面时,添加更新面板是没有意义的。
删除不必要的更新面板,并尝试这样做。它会帮到你的。
发布于 2015-10-21 05:36:20
在按钮中添加OnClick事件
https://stackoverflow.com/questions/33251409
复制