Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 02, 2010 05:28 AM by JayHarry
Member
223 Points
114 Posts
Apr 04, 2007 03:37 AM|LINK
I use i button click to popup a window.
Below is the coding.
dim strname as string
btn.Attributes.Add("click", "window.open('WebForm2.aspx','','width=300px,height=200px');")
How do i pass the parameter ?
btn.Attributes.Add("click", "window.open('WebForm2.aspx?username=strname','','width=300px,height=200px');")
how do i integrate it???
Star
13736 Points
3177 Posts
Apr 04, 2007 02:50 PM|LINK
Just like this:
btn.Attributes.Add("click", "window.open('WebForm2.aspx?username=" & strname & "','popWin','width=300px,height=200px');")
Hope this helps! Don't forget to mark the most helpful post(s) as Answer for the sake of future readers. Thanks!
11 Points
56 Posts
May 25, 2007 04:57 PM|LINK
Ok that fine I have a similar problems, I do the pop up good but is block by pop up block, how I stop the pop block not block my window
this is my code.
Response.Write("<script language='javascript'>");
Response.Write("parent.window.open('pg_resultsowner.aspx?" + var1+ var2 + intRoomQty + cnigth + "')");
Response.Flush();
Adolfo Foliaco
4 Points
2 Posts
May 29, 2008 10:08 AM|LINK
I tried this.but i can,t getting popup window on page load if self.its getting on refrshing the page.please help me.
May 29, 2008 10:15 AM|LINK
this code is wrking fine on refreshing the apge only,not on page load itself.please help me.
All-Star
82577 Points
15430 Posts
MVP
May 29, 2008 02:34 PM|LINK
Try this:
private void Page_Load(object sender, System.EventArgs e) { string userName = "John Doe"; string javaScript = "<script type='text/javascript'>\n" + "<!--\n" + "window.onload = function ()\n" + "{\n" + " window.open('Page2.aspx?username=" + userName + "', 'newWin','width=300px,height=200px');\n" + "}\n" + "// -->\n" + "</script>\n"; this.RegisterStartupScript("OnLoadScript", javaScript); }
Note that RegisterOnSubmitStatement, RegisterStartupScript, RegisterClientScriptBlock, etc have changed since version 1.1 and you will get a compiler warning with the above. See http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx for more info.
NC...
2 Points
1 Post
Nov 02, 2010 05:28 AM|LINK
Thanks man it worked...............
calvinkwoo30...
Member
223 Points
114 Posts
Re: Pop up Window When Page Load
Apr 04, 2007 03:37 AM|LINK
I use i button click to popup a window.
Below is the coding.
dim strname as string
btn.Attributes.Add("click", "window.open('WebForm2.aspx','','width=300px,height=200px');")
How do i pass the parameter ?
btn.Attributes.Add("click", "window.open('WebForm2.aspx?username=strname','','width=300px,height=200px');")
how do i integrate it???
JoshStodola
Star
13736 Points
3177 Posts
Re: Pop up Window When Page Load
Apr 04, 2007 02:50 PM|LINK
Just like this:
btn.Attributes.Add("click", "window.open('WebForm2.aspx?username=" & strname & "','popWin','width=300px,height=200px');")Hope this helps! Don't forget to mark the most helpful post(s) as Answer for the sake of future readers. Thanks!
adolfo_folia...
Member
11 Points
56 Posts
Re: Pop up Window When Page Load
May 25, 2007 04:57 PM|LINK
Ok that fine I have a similar problems, I do the pop up good but is block by pop up block, how I stop the pop block not block my window
this is my code.
Response.Write("<script language='javascript'>");
Response.Write("parent.window.open('pg_resultsowner.aspx?" + var1+ var2 + intRoomQty + cnigth + "')");
Response.Write("</script>");Response.Flush();
Adolfo Foliaco
Back to 7
anuprabha
Member
4 Points
2 Posts
Re: Pop up Window When Page Load
May 29, 2008 10:08 AM|LINK
I tried this.but i can,t getting popup window on page load if self.its getting on refrshing the page.please help me.
anuprabha
Member
4 Points
2 Posts
Re: Pop up Window When Page Load
May 29, 2008 10:15 AM|LINK
this code is wrking fine on refreshing the apge only,not on page load itself.please help me.
NC01
All-Star
82577 Points
15430 Posts
MVP
Re: Pop up Window When Page Load
May 29, 2008 02:34 PM|LINK
Try this:
private void Page_Load(object sender, System.EventArgs e)
{
string userName = "John Doe";
string javaScript =
"<script type='text/javascript'>\n" +
"<!--\n" +
"window.onload = function ()\n" +
"{\n" +
" window.open('Page2.aspx?username=" + userName + "', 'newWin','width=300px,height=200px');\n" +
"}\n" +
"// -->\n" +
"</script>\n";
this.RegisterStartupScript("OnLoadScript", javaScript);
}
Note that RegisterOnSubmitStatement, RegisterStartupScript, RegisterClientScriptBlock, etc have changed since version 1.1 and you will get a compiler warning with the above.
See http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.aspx for more info.
NC...
JayHarry
Member
2 Points
1 Post
Re: Pop up Window When Page Load
Nov 02, 2010 05:28 AM|LINK
Thanks man
it worked...............