Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Button_Click

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

721 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