Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 23rd, 2006, 01:26 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default After Update, Need to Popup another window

Hello
When the user clicks Button1, you go through updating the database process. If this is a success only then will another window need to popup with a URL: someurl.aspx?ID=2
I need to pass the ID to URL.

How do I do this in ASP.NET with VB.NET.
Help.
Thank you.

 
Old March 23rd, 2006, 05:02 AM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to JasonGuo
Default

Just do as follows:

int id;

.......................

String script = "<script>";
script += "window.open('someurl.aspx?id='"+id.ToSting()+",'' )";
script += "</script>";
if (!this.IsClientScriptBlockRegistered)
{
this.RegisterClientScriptBlock("js",script);
}
 
Old March 25th, 2006, 06:20 AM
Authorized User
 
Join Date: Jan 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here is the code for ur query.just copy and paste the following code and will get u desired result.

Response.Write("<script>window.open('someurl.aspx? ID=2');</script>")

 
Old March 25th, 2006, 07:52 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I forgot to mention, that i need a popup without the back button, address bar.

Thank you.

 
Old March 28th, 2006, 12:47 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

hotshot, your code will not work. When writing JavaScript out to the browser via Response.write you have to do something like this

strJavaScript = "<script language=javascript>"
'code
strJavaScript +="</scr" & "ipt>"

If you dont do this you will get an "Invalid Pointer" JS error at runtime. (all aspx pages use javascript for the postback function so using your example will cause the script to fail.)

You can use Jason's code or the following code to achieve your results:

priave sub button1_click....
   Dim strJavaScript as new system.text.stringBuilder

   strJavaScript.append("<script language=javascript>")
   strJavaScript.append("window.open('yourwindow.aspx ','yourwindowname','toolbar=0,menubar=0,directorie s=0');")
   strJavaScript.append("</scr" &"ipt>")
   response.write(strJavaScript)

end sub


hope that helps you.


"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
XmlHttp in popup window Guy g. Ajax 1 December 12th, 2007 03:56 AM
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Popup window from javascript arnabghosh Javascript How-To 1 March 2nd, 2006 10:17 AM
popup window sankar Pro VB 6 0 July 29th, 2003 01:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.