Friday, 21 October 2011

Update Panel in Radio Button List

  <asp:ScriptManager ID="scriptManager" EnablePartialRendering="true" runat="server" />
      
        <asp:UpdatePanel ID="myUpdatePanel" runat="server">
            <ContentTemplate>
                <asp:Label ID="myLabel" Text="Initial Text" runat="server" />
            </ContentTemplate>
            <Triggers>
             <asp:PostBackTrigger ControlID="myRadioButtonList"/>
            
               
            </Triggers>
        </asp:UpdatePanel>

        <asp:TextBox ID="myTextBox" AutoPostBack="true" OnTextChanged="myTextBox_TextChanged" runat="server" />
               
        <asp:RadioButtonList ID="myRadioButtonList" AutoPostBack="true"
                OnSelectedIndexChanged="myRadioButtonList_SelectedIndexChanged" runat="server">
            <asp:ListItem Value="Radio Button 1" />
            <asp:ListItem Value="Radio Button 2" />
            <asp:ListItem Value="Radio Button 3" />
        </asp:RadioButtonList>

Thursday, 20 October 2011

How to make textbox read only property true from server side

If TextBox's ReadOnly property is "true", postback data won't be loaded e.g it essentially means TextBox being readonly from server-side standpoint (client-side changes will be ignored). If you want TB to be readonly in the "old manner" use TextBox1.Attributes.Add("readonly","readonly") as that won't affect server-side functionality.