473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to open page in new window after click button

hi guys i m a beginner in Asp.net
can u tell me that how to open page in new window after click button as well as i want to pass some data from this page.

thanks
Apr 13 '07 #1
4 11050
JSha
17
Hello,

Check this page out and the code out...
http://www.javascripter.net/faq/openinga.htm

so...something like...

window.open(url,name, features)
var url = "url?param1=sample&param2=sampl23&param3=sampl e3";
var name = "windowName";
var features = "toolbars=no,etc.";
window.open(url,name, features);

example...

function NewWindow (jsppage)
{
var mnth = document.forms[0].cmbmonth.value;
var yr = document.forms[0].cmbyear.value;
page = jsppage+'?cmbmonth='+mnth + '&cmbyear=' +yr
window.open(jsppage,"","height=250,width=400,statu s=no,location=no,toolbar=no,directories=no,menubar =no");
}

Hope this helps...

-JSha
Apr 13 '07 #2
prp
18
hi guys i m a beginner in Asp.net
can u tell me that how to open page in new window after click button as well as i want to pass some data from this page.

thanks
U can Use Response.Redirect("Webform.aspx");
Before it u need to save data of this page U can use the following:
Session["session_name"]=Textbox1.Text;
Apr 13 '07 #3
gomzi
304 100+
hi guys i m a beginner in Asp.net
can u tell me that how to open page in new window after click button as well as i want to pass some data from this page.

thanks
use this on buttonclick,

dim var1value as string = "wow"
dim url as string = "http://www.something.com/mypage.aspx?var1=" & var1value

response.write("<script>")
response.write("window.open('" & url & "');")
response.write("</script>")
Apr 13 '07 #4
thanks everyone i got the solution

solution is that :
u just add base tag in ur webform page
for eg:

<HEAD>
<title>WebForm2</title>
//this base Tag will open page in new window on button click.
<base target="_blank">
</HEAD>
Apr 18 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Wladimir Borsov | last post by:
Inside a html page (more precicesly inside a JSP page) I defined a button. When the user clicks this button a second browser window should pop up und load the passed URL. I coded <img...
3
by: Leonard | last post by:
I have a button on my web app, that opens a help html page. I use this code: HttpContext.Current.Response.Write("<script>") HttpContext.Current.Response.Write("window.open('" & sUrl & "','_new')")...
2
by: yatharth | last post by:
I am facing a problem ,the situation is like this. I have a home page named "Index.html" ,on which there is login link,when i click on the login link the login popup opens and user enter the...
6
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a...
2
by: Mariame | last post by:
Hi everyone I have a button that open a new web page so i use the following script response.write("<script>window.open(url,'Name')</script>") every time the user click on the button it opens a new...
3
by: hb | last post by:
Hi, I have a asp:button btnGo. When clicking this button, the code will parse a asp:table to find a specific ID under certain conditions. Once the ID is found, the code need to keep the current...
2
by: Chris | last post by:
I know this is a dead horse I'm beating but why is it so impossible to ask for functionality in the HTML tag to open a window/page more controllable? why is: <a href="somepage.aspx?value1=xyz"...
3
by: ACaunter | last post by:
Hi all, I need to set a session variable and open a new window with a single click of an asp.net button. My problem is that it always takes two clicks.. one sets the session and the other opens...
2
by: carlor | last post by:
Hi there, I have a form that contains a link button. When the user clicks the link button I need to enable a couple of other buttons on the page and open a new browser window giving it focus...
6
by: shil | last post by:
I have a server side button that needs to do some preperation and afterwards, if everything goes well, open a new browser with a specific url. I know how to execute javascript from a server side...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.