views:

81

answers:

2

Hello, I have an update panel with a gridview and some radios inside it. Senario is that when user select a radio, some bottoms get visible. But after radio eventhandler is trigered, updatepanel contents get dissapered. Any idea about this problem?

<asp:ScriptManager ID="scriptManager_main" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="updatePanel_main" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gridView_stLists" runat="server" AutoGenerateColumns="False" CellPadding="3"
                BorderStyle="NotSet" CssClass="table_layout" Width="500">
                <RowStyle CssClass="table_body" />
                <Columns>
                    <asp:TemplateField HeaderStyle-Width="20">
                        <ItemTemplate>
                            <asp:RadioButton ID="rdBtn_stdl" runat="server" OnCheckedChanged="rdBtn_stdl_CheckedChanged"
                                AutoPostBack="True" GroupName="stdl" value='<%# Eval("uri") %>' />
                        </ItemTemplate>
                        <HeaderStyle Width="20px" />
                    </asp:TemplateField>
...
A: 

Need to see some server-side code. I suspect the grid is not being re-created on post-back.

n8wrl
I think i've found the answer. I didn't know each time, updatepanel runs Page_Load again. So one of my functions runs again and this happens.Thank you very much for your answer
Ehsan
+1  A: 

The RadioButton is doing an AutoPostBack. Are you rebinding to the GridView after postback and thus overridding your changes/state? Only DataBind if !IsPostBack and this might address the issue.

Ben Griswold
I think i've found the answer. I didn't know each time, updatepanel runs Page_Load again. So one of my functions runs again and this happens. Thank you very much for your answer
Ehsan