Question

I have a UserControl1 within a UserControl2. The first UserControl1 has a RadioButtonList on it with multiple radio button when clicked causes a postback and does it work. In UserControl2 i have a html textarea with runat="server" attribute with a save button.

Then I am using UserControl2 on a page.

Issue : When the user is writing some text in the textarea(UserControl2) and in between when he tries to click anyone of the Radiobutton(from UserControl1) the page is posted back and the text value of the textarea is lost. I have also enable viewstate for the textarea.

Please guide me. How can I save the value of the textarea when the user clicks a radio button.

No correct solution

OTHER TIPS

I cannot comment yet, and it's hard to guess the problem without seeing the code, but have you enabled the viewstate on the usercontrol2?

    <asp:RadioButtonList ID="RadioButtonList1" runat="server">
    <asp:ListItem Value="a" />
    <asp:ListItem Value="b" />
    </asp:RadioButtonList>
    <u:UserControl2 ID="UC2" runat="server" EnableViewState="true" ViewStateMode="Enabled"/>

(EnableViewState defaults to true)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top