Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Button_Click

Posted on 2004-03-30
4
Medium Priority
?
338 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

885 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