Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP RadioButton Group Selected Index
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01452311
Message ID:
01452323
Vues:
23
radOptions.SelectedIndex = 0;
You're re-setting it Page_Load() which fires before the button click .....


>
>protected void Page_Load(object sender, EventArgs e)
>{
>    if (!IsPostBack)
>    {
>        DataLayer.ConnectionString = ConfigurationSettings.AppSettings["ConnString"];
>        DataLayer.ProviderInvariantName = "System.Data.SqlClient";
>    }
>
>    ReportId = Convert.ToInt32(Request.QueryString["reportid"]);
>    _SetupPage();
>
>    radOptions.SelectedIndex = 0;
>}
>
>
>
>
>_SetupPages sets up some other controls on the form from a DS. Not applicabgle here.
>
>
>>>... is always zero....
>>
>>What is it in Page_Load() ?
>>
>>>
>>>Defined like this
>>>
>>><asp:radiobuttonlist id="radOptions" Font-Names="Arial" Font-Size="10pt" runat="server">
>>>    <asp:listitem id="option1" runat="server" value="Display On Screen" />
>>>    <asp:listitem id="option2" runat="server" value="Show Report" />
>>>    <asp:listitem id="option3" runat="server" value="Export To File" />
>>></asp:radiobuttonlist>
>>>
>>>
>>>Checking it in a button like this
>>>
>>>
>>>protected void cmdRunReport_Click(object sender, EventArgs e)
>>>{
>>>    switch (radOptions.SelectedIndex)
>>>    {
>>>        case 0:
>>>            _ShowOnScreen();
>>>            break;
>>>
>>>        case 1:
>>>            _ShowGrid();
>>>            break;
>>>
>>>        case 2:
>>>            _SendToFile();
>>>            break;
>>>    }
>>>}
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform