...

View Full Version : Submit button



siri06
06-08-2011, 07:59 AM
Hi there ,

I have a situation that ,

two options are provided to the user with two radio buttons he can select one and clicks a submit button based on the selection the submit button should redirect to the page ,

for example if he selects male then submit button redirect to male page , or if he selects female then submit button redirect to female page like...........


this functionality using asp.net.


Thanks,
Shireesha.

Mike_O
06-08-2011, 04:45 PM
Hi Shireesha,

You would have a setup that would look something like this

Your controls:

.
.
.
<asp:RadioButtonList ID="Radio1" runat=server>
<asp:ListItem Value="Male">Male</asp:ListItem>
<asp:ListItem Value="Female">Female</asp:ListItem>
</asp:RadioButtonList>

<asp:Button ID="Submit" runat="server" OnClick="Submit_OnClick" />
.
.
.
Your codebehind (the submit button onclick handler):

.
.
.
protected void Submit_OnClick(object sender, EventArgs e)
{
if (Radio1.SelectedValue = "Male")
{
Response.Redirect("MalePage.html");
}
else
{
Response.Redirect("FemalePage.html");
}
}
.
.
.
Regards,
Mike

siri06
06-09-2011, 01:09 AM
Hi Shireesha,

You would have a setup that would look something like this

Your controls:

.
.
.
<asp:RadioButtonList ID="Radio1" runat=server>
<asp:ListItem Value="Male">Male</asp:ListItem>
<asp:ListItem Value="Female">Female</asp:ListItem>
</asp:RadioButtonList>

<asp:Button ID="Submit" runat="server" OnClick="Submit_OnClick" />
.
.
.
Your codebehind (the submit button onclick handler):

.
.
.
protected void Submit_OnClick(object sender, EventArgs e)
{
if (Radio1.SelectedValue = "Male")
{
Response.Redirect("MalePage.html");
}
else
{
Response.Redirect("FemalePage.html");
}
}
.
.
.
Regards,
Mike







Dear Mike thanks for yuoe reply
works perfect



Siri06



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum