Solved

Button_Click

Posted on 2004-03-30
4
325 Views
Last Modified: 2008-02-26
How do i redirect a page from a button_Click control by using

location.href="Page.aspx" through javascript.





0
Comment
Question by:Moizsaif123
  • 2
4 Comments
 
LVL 6

Expert Comment

by:dgelinas
ID: 10715470
add to your button tag

onclick='location.href="Page.aspx"'
0
 
LVL 4

Author Comment

by:Moizsaif123
ID: 10715623
I put this code in the html page,It doenst work...


<INPUT id="Submit1" onclick='location.href="WebForm2.aspx"' style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 78px" type="submit" value="Submit" name="Submit1" language="javascript" runat="server">
0
 
LVL 6

Expert Comment

by:dgelinas
ID: 10715679
This works for me

<INPUT id="Submit1" onclick="location.href='http://www.google.com'" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 78px" type="submit" value="Submit" name="Submit1" language="javascript" runat="server">

What exactly is happening and are you given an error?  WebForm2.aspx is in the same directory as the page with this button right?
0
 
LVL 16

Accepted Solution

by:
jaysolomon earned 50 total points
ID: 10715708
type="submit"  submits a form to the action that the form is set to

try changing to  type="button"

i have .NET installed and will see what i can do
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
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.
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now