Solved

asp.net - javascript- on client side pull aonther .aspx page on click

Posted on 2011-02-27
2
463 Views
Last Modified: 2012-05-11
how do I code a js function so that on button click it will direct to another page

               <td>
                    <a href="javascript:GoTo('Page2','')">
                    <img alt="Step 2 - Inside Front Cover" border="0"
                        src="https://ggg/MRCTest/img/Partvailer/ProgvssBar/Offv.gif" /></a></td>
0
Comment
Question by:GlobaLevel
2 Comments
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 34992346
Javascript function
<script type="text/javascript" language="javascript">
        function redirect()
        {
        window.location = "http://www.google.com";
        }
    </script>

Open in new window


ASPX Button
<asp:Button ID="Button1" runat="server" 
            Text="Button" OnClientClick="javascript:redirect();" />

Open in new window


Hope this helps!
Raj
0
 
LVL 16

Expert Comment

by:BurnieP
ID: 34992402
You can just put the location of your next page using your a href?

<td><a href="Page2.html"><img alt="Step 2 - Inside Front Cover" border="0"  src="https://ggg/MRCTest/img/Partvailer/ProgvssBar/Offv.gif" /></a></td>
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question