Button click JScript window has wrong request.QueryString
-
I used something very similar to this with a dropdownlist selectedindexchange event, and it worked. I figured I'd try it here with a button click event. Any suggestions on how to get this to work?
-
The page that has this button, "Update Budget", has the querystring value already that I want. I put that in a label, lblSAID, when the page loads. If I could put request.QueryString("ScheduleActivityID") in the javacode, that'd be great, but it looks like I have to assign it to a variable first. this.value simply puts the value of the button in the querystring when going to the pop-up window
-
The page that has this button, "Update Budget", has the querystring value already that I want. I put that in a label, lblSAID, when the page loads. If I could put request.QueryString("ScheduleActivityID") in the javacode, that'd be great, but it looks like I have to assign it to a variable first. this.value simply puts the value of the button in the querystring when going to the pop-up window
Hmmm..when I try to do "View Source" notepad just hangs. If I use anything else besides this.value in Page_Load, then the popup window won't show. When I do use this.value, then nothing in the button_click handler works anyway. Any other suggestions? Thanks!
-
The page that has this button, "Update Budget", has the querystring value already that I want. I put that in a label, lblSAID, when the page loads. If I could put request.QueryString("ScheduleActivityID") in the javacode, that'd be great, but it looks like I have to assign it to a variable first. this.value simply puts the value of the button in the querystring when going to the pop-up window
-
Hmmm..when I try to do "View Source" notepad just hangs. If I use anything else besides this.value in Page_Load, then the popup window won't show. When I do use this.value, then nothing in the button_click handler works anyway. Any other suggestions? Thanks!
Empty the Temporary Internet Files, and lower the maximum size of the Temporary Internet Files folder to a reasonable value, like 10 MB. The default value is a certain percent of the entire hard drive, which comes to a ridiculously large value with the sizes of todays hard drives. If you use anything besides this.value that is correct javascript code, the popup window will show. Like this.tagName, this.id, this.name, window.location.href, 'hello', 'anything'... As I said in my first post, you can't use the onclick property when you have a server event that handles the click, as the server event uses the onclick property. --- b { font-weight: normal; }
-
It's not Java code, it's Javascript code. You can get the value from querystring in javascript: Javascript: querystring[^] --- b { font-weight: normal; }
Guffa, So, if I use only the following in the Page_Load (nothing in the button click handler), the window does pop-up, but nothing in the Request.QueryString(): Dim strSAID As String = Request.QueryString("ScheduleActivityID") btnUpdateBudget.Attributes.Add("onClick", "window.open('UpdateBudgetConfirm.aspx?UBID='+'strSAID.ToString()','','width=500,height=300,left=200,top=200');")
-
Guffa, So, if I use only the following in the Page_Load (nothing in the button click handler), the window does pop-up, but nothing in the Request.QueryString(): Dim strSAID As String = Request.QueryString("ScheduleActivityID") btnUpdateBudget.Attributes.Add("onClick", "window.open('UpdateBudgetConfirm.aspx?UBID='+'strSAID.ToString()','','width=500,height=300,left=200,top=200');")
The url of the page you open in the window will look like this: UpdateBudgetConfirm.aspx?UBID=strSAID.ToString() If you want to use the value of the strSAID string, you have to concatenate it with the string containing the javascript. E.g.: ...aspx?UBID=" + strSAID + "',','width... --- b { font-weight: normal; }
-
The url of the page you open in the window will look like this: UpdateBudgetConfirm.aspx?UBID=strSAID.ToString() If you want to use the value of the strSAID string, you have to concatenate it with the string containing the javascript. E.g.: ...aspx?UBID=" + strSAID + "',','width... --- b { font-weight: normal; }
-
I tried this, but now...no pop-up window: btnUpdateBudget.Attributes.Add("onClick", "window.open('UpdateBudgetConfirm.aspx?UBID='" & Request.QueryString("ScheduleActivityID") & ",'','width=500,height=300,left=200,top=200');")
That is because you have placed the value from the querystring outside of the javascript string. Your javascript code will look like: window.open('UpdateBudgetConfirm.aspx?UBID='42,'','width=500,height=300,left=200,top=200'); Put the value inside the string, like the code I showed you in my previous post. --- b { font-weight: normal; }
-
That is because you have placed the value from the querystring outside of the javascript string. Your javascript code will look like: window.open('UpdateBudgetConfirm.aspx?UBID='42,'','width=500,height=300,left=200,top=200'); Put the value inside the string, like the code I showed you in my previous post. --- b { font-weight: normal; }
Thanks Guffa! That was the trick. Here's what I used: Dim strSAID As String = Request.QueryString("ScheduleActivityID") btnUpdateBudget.Attributes.Add("onClick", "window.open('UpdateBudgetConfirm.aspx?UBID=" + strSAID + "','','width=500,height=300,left=200,top=200');")