Solved

Button_Click

Posted on 2004-03-30
4
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

730 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