Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 Submit button

View previous topic View next topic Go down 
AuthorMessage
Kookie
Member
Member
avatar

Posts : 12
Join date : 2011-03-09

Submit button Empty
PostSubject: Submit button   Submit button EmptyWed Jun 29, 2011 7:35 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.
Back to top Go down
HGRaptor
Member
Member
HGRaptor

Posts : 3
Join date : 2011-04-17

Submit button Empty
PostSubject: Re: Submit button   Submit button EmptyWed Jun 29, 2011 7:42 am

You would have a setup that would look something like this

Your controls:
Code:

.
.
.
<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):
Code:

.
.
.
protected void Submit_OnClick(object sender, EventArgs e)
{
    if (Radio1.SelectedValue = "Male")
    {
        Response.Redirect("MalePage.html");
    }
    else
    {
        Response.Redirect("FemalePage.html");
    }
}
.
.
.
Back to top Go down
Kookie
Member
Member
avatar

Posts : 12
Join date : 2011-03-09

Submit button Empty
PostSubject: Re: Submit button   Submit button EmptyWed Jun 29, 2011 7:43 am

Thank you raptor!!!
Back to top Go down
Sponsored content




Submit button Empty
PostSubject: Re: Submit button   Submit button Empty

Back to top Go down
 

Submit button

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Submit values using other than <input>
» Data grid binding a balnk after "add new row" button click
» how to create a pop out button
» Referencing a button in a template
» Help with a button click counter

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: Submit button Edit-trash Useless :: Trash-