You must Sign In to post a response.
  • Category: HTML

    redirect to another page code for html button

    Hi,
    how to write redirect to another page code for html button
    generally for asp.net we r writing like this
    Response.Redirect("Default2.aspx");
    how to write that code in html & where to write
  • #248718
    u can use javascript

    in onclick event u can write

  • #248720
    how to write there ( code )

  • #248723
    on form tab put action="pagename.aspx" and take button type=submit

    This will help u..

  • #248729
    There Are Many Ways To Do IT
    1. in onclick you have to write a javascript function and in function write window.nevigate(URL);
    2. use action="URL" in form tag
    3. use location.href=URL in onclick event

    Here URL is the URL You Want TO Redirect.

    Regards,
    Milind Kansagara
    Web Developer (Cybercomcreation)
    Ahmedabad.
    http://milindkansagara1984.blogspot.com

  • #248785
    //html button designing and calling the event in javascript
    <input id="btntest" type="button" value="Check"
    onclick="return btntest_onclick()" />
    <script language="javascript" type="text/javascript">

    function btntest_onclick()
    {
    window.location.href("Home.aspx");
    }

    </script>

  • #249057
    Hi,
    In the Onclick eventof the Button you can call a javascript. For transfering the control to the next page you can use. Window.Transfer("page.aspx")

    All is well.
    Thanks,
    Dharma
    Editor,Mentor,MVM
    Try and fail but don't fail and try

  • #249187
    Hi,

    <a href="Javascript:window.location.href='Test.aspx';"><img src="images/button_close.gif" height='16' width='60' alt='Close Window' border='0'></a>

  • #250025
    on form tab put action="pagename.aspx" and take button type=submit

  • #260907
    You can make this by three ways...

    1. on button click event
    In this you call the funcation which is created in java script and access it.

    like...

    <script language="javascript" type="text/javascript">

    function btntest_onclick()
    {
    window.location.href("Home.aspx");
    }

    </script>
    you call this by
    <input id="btntest" type="button" value="Check"
    onclick="return btntest_onclick()" />
    so when you click the button it will access...

    2. using hyperlink tag itself...

    <a href="Javascript:window.location.href='Test.aspx';">Click Here</a>

    so when you click the text 'Click Here' you can redirect to next page...

    3. in form, give the url in action attribute

    for example

    <form id="f1" action="default2.aspx" method="get">
    ....
    <input type=submit value="Click"/>
    </form>

    then you can redirect to next page

  • #315578
    you can do it in 2 ways.

    1. use javascript and write it on button click
    2. you can use form and use method=post and action=desired page

    cheers
    chandu

    Free Online,Offline Sessions
    www.hyderabadtechies.info

    chandrashekarthota@gmail.com /92 93 95 95 39

  • #346807
    <INPUT type="button" value="To Title Page" onClick="location.href='index.htm'">

    Try this...

    Cheers

  • #346812
    <input onclick="document.location = 'index.html';" type="button" value="Click here to send Enquiry">

    Try this also....


    Cheers...


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.