0

In local working correctly, but when I am doing registration on liver server then some time registration is redirecting to successfully page and some time not redirecting, and also not getting any error message. The registration form is very big, so, I am not putting all design, code but I have taken code from every block. According to me panel are the problem may be, But another thing I had to observe if the page is not registration, then I reload again same page, then fill all details then its taking submission.

Page Load Code:

 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);
}

Design Code:

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>

Thanks in advance.

asked Oct 21, 2015 at 5:12

2 Answers 2

1

Your update panels are making the problems in redirection. Please note that, update panel is only used for AJAX request. It will post only selected panel data. So it will not make sense to add Update panel, when you want redirection from one page to another.

Remove unnecessary update panels and try to do it. It will help you.

answered Oct 21, 2015 at 5:42
Sign up to request clarification or add additional context in comments.

2 Comments

Ok. So you can use Postback trigger to enforce your post back and redirection. There are also alternate options of update panel. You can use Jquery Ajax instead of update panel.
Can give me that postback trigger code to my above code. @azhar
0

add OnClick Event in your Button

answered Oct 21, 2015 at 5:36

6 Comments

What happens if i add, add on lick event. @aliasghar
you can add event click and redirect to another page but you must remove your update panel . because don't allow redirect
Update panel is necessary some place, is there any different solution, its a big form. @aliasghar
Already i have following code: if (Status == "Success") { Response.Redirect("registrationthanks.aspx"); }
you can use javascript like this ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType, "redirect", "location.href = 'registrationthanks.aspx'", True)
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.