Click here to Skip to main content
15,910,009 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In page-1 I have 8 textbox with a checkbox and a button. All these are inside update panel.
All textbox's have 'autopostback=false'. The checkbox is with 'autopostback=true'. Now, after filling all the textbox's (checkbox not ticked) I click the button. The page-1 is redirected to page-2. From page-2 I use back arrow button. Page-1 with data in Textbox's are displayed as it is.
Now, with same data I tick the checkbox (autopostback=true) and press that button. Page-2 is displayed. Now at page-2 I use the back arrow button. Page-1 is blank without any data in any of the textbox's!. If I keep the checkbox outside the update panel it works well but when I tick the checkbox the page goes to server and returns. How to find a solution for this? I want the checkbox to be inside the UpdatePanel. Should I have a separate UpdatePanel for thsis checkbox within the main UpdatePanel.
Posted
Comments
Can't you handle the CheckedChange functionality at client side? What exactly you are doing in that?
S.Rajendran from Coimbatore 27-Dec-13 9:38am    
<asp:CheckBox ID="GuestChkBox" runat="server"
OnCheckedChanged="CheckBox1_CheckedChanged" Position="Absolute"
Checked="false" Text='Send to guest' AutoPostBack="true"
style=" z-index:1; margin-top:620px; margin-left:245px; font-size:larger; left: 215px; top: 124px; position: absolute;"
Width="153px" >

<asp:RadioButtonList ID="RadioButtonList6" runat="server"
RepeatDirection="Vertical"
style="z-index: 1; left: 610px; top: 745px; position: absolute; height: 35px; width: 262px"
AutoPostBack="True"
onselectedindexchanged="RadioButtonList6_SelectedIndexChanged">
<asp:ListItem>Deliver at the above address
<asp:ListItem>Deliver at a different address

protected void CheckBox1_CheckedChanged(Object sender, EventArgs e) // 'send to guest' check box
{

Panel4.Visible = true;
Label18.Visible = true;
if (GuestChkBox.Checked)
{

RadioButtonList6.Visible = true;
v_SendToGuestTag = "*";
v_sendtoguestyesorno = "Y";
}
else
{

v_sendtoguestyesorno = "N";
v_SendToGuestTag = "";
RadioButtonList6.Visible = false;
Panel1.Visible = false;
RadioButtonList6.Items.Clear();
RadioButtonList6.Items.Add("Deliver at the above address");
RadioButtonList6.Items.Add("Deliver at a different address");
Label183.Visible = false;
}

}
Try to all these things in client side.
S.Rajendran from Coimbatore 27-Dec-13 9:47am    
With regard to that checkbox, how to do in client side?
Add a onclick client side event or simple attach jQuery event for checkbox. You can easily find the implementation through Google.

In that event try to achieve all the things you are currently doing in server side, which I guess you can easily do.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900