SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast dpmoe's Avatar
    Join Date
    Apr 2005
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it possible to link a button to URL ?

    Hi there

    i looked through many sites and searched many forms but i didnt see anyone talking about linking a button to guied you to the next page?

    I just started building my own webiste so it might be lil hard for me to grasp

    my main question is simply.. if you wanted people to register in your site and after the entered all of their details and just going to press the "Register Button" i want to take them to another page that says register was succesful. so how can i do that and add this option to a simple button in ASP.NET HTML using C# ?

    Thank yoooooooooooooou
    Moe

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    That is easily done through php (or any server language) scripts. You will have better luck asking this in one of the server-side sections here.

  3. #3
    SitePoint Enthusiast dpmoe's Avatar
    Join Date
    Apr 2005
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry to post it i found out it was really soooo dum of me, i tried after posting this and i managed to do it
    simply all a person shud do is:

    after declaring a button
    <asp:Button id="btnReg" Text="Register" runat="server" OnClick="btnReg_Click" />

    as we see above we make a method >>>>OnClick="btnReg_Click"<<<<

    and then we make the method

    public void btnReg_Click(object s, EventArgs e)

    {
    * we make a string and add the wanted page to go to in my case i needed registrat the customer then take him to sign In page*

    String strSignIn = "SignIn.aspx";
    *your data base code goes here*
    and fianlly u add this code
    Response.Redirect(strSignIn)
    }
    dam when i look at it i feel so dum!!!

  4. #4
    O Rly?? JakeJeck's Avatar
    Join Date
    Nov 2000
    Location
    Milwaukee
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't want the button to postback (like the one you have) you can use a linkbutton.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •