Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 07, 2012 11:20 AM by kirupa.v
Member
11 Points
103 Posts
May 07, 2012 09:11 AM|LINK
how can i call on page load if (listitem value 0) then
RadioButtonList button is another page and check different page
<asp:RadioButtonList ID="rlstExport" runat="server">
<asp:ListItem Selected="True" Value="0">View in Browser </asp:ListItem>
<asp:ListItem Value="1">Export Report to Excel</asp:ListItem>
<asp:ListItem Value="2">Export Report to Access</asp:ListItem>
<asp:ListItem Value="2">Export Report to CSV</asp:ListItem>
</asp:RadioButtonList>
Participant
878 Points
264 Posts
May 07, 2012 09:17 AM|LINK
protected void Page_Load(object sender,EventArgs e)
{
if(rlstExport.SelectedValue=="0") { // do your code }
}
May 07, 2012 09:22 AM|LINK
not working
Star
10672 Points
2426 Posts
May 07, 2012 09:43 AM|LINK
zohaibak RadioButtonList button is another page and check different page
What do you mean by this?
Your RadioButtonList is in one page and you want to check it from some other page? Please make it clear.
May 07, 2012 10:45 AM|LINK
suppose i have radiobutton list on page check.aspx
and i want to get radio button list item value on page check2.aspx.cs
how can we store radiobuttonlist item value and use if else condition in check2.aspx.cs page
like
if(radiobuttonlist item value==0)
is this possible
Contributor
2070 Points
531 Posts
May 07, 2012 11:20 AM|LINK
Hi,
In the pageload event of check.aspx page paste the following code
protected void Page_Load(object sender, EventArgs e) { if (rlstExport.SelectedValue == "0") { Session["Radio"] = '0'; } else if (rlstExport.SelectedValue == "1") { Session["Radio"] = '1'; } else if (rlstExport.SelectedValue == "2") { Session["Radio"] = '2'; } else { Session["Radio"] = '3'; } Response.Redirect("check2.aspx"); }
In the check2.aspx page place a label in design
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
In code behind pageload paste the following
protected void Page_Load(object sender, EventArgs e) { if (Session["Radio"] == "0") { Label1.Text = "Radio 0"; } else if (Session["Radio"] == "1") { Label1.Text = "Radio 1"; } else if (Session["Radio"] == "2") { Label1.Text = "Radio 2"; } else { Label1.Text = "Radio 3"; } }
Try this... Reply me for any issues..
zohaibak
Member
11 Points
103 Posts
RadioButtonList
May 07, 2012 09:11 AM|LINK
how can i call on page load if (listitem value 0) then
RadioButtonList button is another page and check different page
<asp:RadioButtonList ID="rlstExport" runat="server">
<asp:ListItem Selected="True" Value="0">View in Browser </asp:ListItem>
<asp:ListItem Value="1">Export Report to Excel</asp:ListItem>
<asp:ListItem Value="2">Export Report to Access</asp:ListItem>
<asp:ListItem Value="2">Export Report to CSV</asp:ListItem>
</asp:RadioButtonList>
ZeeshanAnsar...
Participant
878 Points
264 Posts
Re: RadioButtonList
May 07, 2012 09:17 AM|LINK
protected void Page_Load(object sender,EventArgs e)
{
if(rlstExport.SelectedValue=="0") { // do your code }}
Please 'Mark as Answer' if this post helps you.
zohaibak
Member
11 Points
103 Posts
Re: RadioButtonList
May 07, 2012 09:22 AM|LINK
not working
basheerkal
Star
10672 Points
2426 Posts
Re: RadioButtonList
May 07, 2012 09:43 AM|LINK
What do you mean by this?
Your RadioButtonList is in one page and you want to check it from some other page? Please make it clear.
(Talk less..Work more)
zohaibak
Member
11 Points
103 Posts
Re: RadioButtonList
May 07, 2012 10:45 AM|LINK
suppose i have radiobutton list on page check.aspx
and i want to get radio button list item value on page check2.aspx.cs
how can we store radiobuttonlist item value and use if else condition in check2.aspx.cs page
like
if(radiobuttonlist item value==0)
{
}
is this possible
kirupa.v
Contributor
2070 Points
531 Posts
Re: RadioButtonList
May 07, 2012 11:20 AM|LINK
Hi,
In the pageload event of check.aspx page paste the following code
protected void Page_Load(object sender, EventArgs e)
{
if (rlstExport.SelectedValue == "0")
{
Session["Radio"] = '0';
}
else if (rlstExport.SelectedValue == "1")
{
Session["Radio"] = '1';
}
else if (rlstExport.SelectedValue == "2")
{
Session["Radio"] = '2';
}
else
{
Session["Radio"] = '3';
}
Response.Redirect("check2.aspx");
}
In the check2.aspx page place a label in design
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
In code behind pageload paste the following
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Radio"] == "0")
{
Label1.Text = "Radio 0";
}
else if (Session["Radio"] == "1")
{
Label1.Text = "Radio 1";
}
else if (Session["Radio"] == "2")
{
Label1.Text = "Radio 2";
}
else
{
Label1.Text = "Radio 3";
}
}
Try this... Reply me for any issues..