Solved

Button_Click

Posted on 2004-03-30
4
324 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

705 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

18 Experts available now in Live!

Get 1:1 Help Now