How can I know the chosen option of an RadioGroup by the user from Server Side?

  1. #1

    How can I know the chosen option of an RadioGroup by the user from Server Side?

    <ext:RadioGroup ID="BallsType" runat="server" FieldLabel="Balls">
       <Items>
          <ext:Radio runat="server" ID="BallA" BoxLabel="a"></ext:Radio>
          <ext:Radio runat="server" ID="BallB" BoxLabel="b"></ext:Radio>
          <ext:Radio runat="server" ID="BallC" BoxLabel="c"></ext:Radio>      
       </Items>
     </ext:RadioGroup>
    How can I know the chosen option by the user from Server Side?

    Please, I need your help.

    Thanks.
  2. #2
    Hi,

    Please use
    this.BallsType.CheckedItems[0].ID
    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void GetValue(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("Value", this.BallsType.CheckedItems[0].ID).Show();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:RadioGroup 
                ID="BallsType" 
                runat="server" 
                ColumnsNumber="1" 
                FieldLabel="Balls">
                <Items>
                    <ext:Radio ID="BallA" runat="server" BoxLabel="a" />
                    <ext:Radio ID="BallB" runat="server" BoxLabel="b" />
                    <ext:Radio ID="BallC" runat="server" BoxLabel="c" />
                </Items>
            </ext:RadioGroup>
            <ext:Button runat="server" Text="Get value" OnDirectClick="GetValue" />
        </form>
    </body>
    </html>
  3. #3
    Thanks Daniil.

Similar Threads

  1. [CLOSED] RadioGroup - want each radio option on new line
    By PhilG in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 03, 2012, 2:53 PM
  2. Replies: 3
    Last Post: Dec 26, 2011, 1:32 PM
  3. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  4. Replies: 4
    Last Post: Mar 19, 2010, 11:35 AM
  5. Replies: 6
    Last Post: Sep 01, 2009, 1:06 PM

Posting Permissions