I'm trying to pass a value in the querystring from one page to another. I have a button that opens a new window, and I want to put a variable in the querystring. Here is what I have now in my PageLoad:
When I click it, the page just posts back and no
new windows pop up, no javascript errors occur either, so I can't identify what is wrong. If I remove the +strAssetID part then the page loads fine (but with no querystring values). Any thoughts, or is there an easier way to do this? Thanks.
This is going to create client-side code that looks like this: onclick=window.open('createnew.aspx?assetid='1234); Which will most likely cause a javascript error.
jodybannon
Member
125 Points
25 Posts
passing querystring values to a new window using window.open
Aug 28, 2003 08:04 PM|LINK
btnCreate.Attributes.Add("onclick", "window.open('createnew.aspx?assetid=' + strAssetID);")And the button code is this... When I click it, the page just posts back and no new windows pop up, no javascript errors occur either, so I can't identify what is wrong. If I remove the +strAssetID part then the page loads fine (but with no querystring values). Any thoughts, or is there an easier way to do this? Thanks.JimRoss [MVP...
Star
10080 Points
2008 Posts
Re: passing querystring values to a new window using window.open
Aug 28, 2003 08:17 PM|LINK
MS MVP ASP.NET [VC++/MFC emeritus]
Old Dog Learns New Tricks
Preferred programming language: cuneiform on clay tablets
SushilaSB
Star
11417 Points
2265 Posts
Re: passing querystring values to a new window using window.open
Aug 28, 2003 08:20 PM|LINK
Dim strAssetID As String = "1" Button1.Attributes.Add("onclick", "javascript:window.open('createnew.aspx?id=" + strAssetID + "')")helpsVisual ASP/ASP.NET MVP
http://weblogs.asp.net/sushilasb