Hello,
I want to call a javascript method from the server side using the RadAjaxManager when the user clicks a button. The javascript method is:
and the server-side handler for the button is:
The text I'm passing as the viewId has a backslash in it, like "sometext\moretext". When debugging on the server side, I see that the value of workingView.Id is "sometext\\moretext", so the backslash is being escaped. However, when I debug the javascript line on the client side as it's being called I see that the viewId is being set to "sometextmoretext", with NO backslash at all in it.
I also tried wrapping the parameter in the server side in single quotes RunReport('{0}') but that didn't change the behavior. I feel like I'm overlooking something obvious, but can't quite figure it out.
Any help would be much appreciated.
Thanks!
Eddie
I want to call a javascript method from the server side using the RadAjaxManager when the user clicks a button. The javascript method is:
| function RunReport(viewId) { |
| var reportWindow = window.open('DisplayView.aspx?viewId=' + viewId, '_blank', "height=700,width=900,left=20,top=20,scrollbars=auto,status=no,resizable=yes,toolbar=no,menubar=no,location=no"); |
| } |
and the server-side handler for the button is:
| protected void testReport_Click(object sender, EventArgs e) |
| { |
| radViewAjaxManager.ResponseScripts.Add(string.Format("RunReport(\"{0}\");", workingView.Id)); |
| } |
The text I'm passing as the viewId has a backslash in it, like "sometext\moretext". When debugging on the server side, I see that the value of workingView.Id is "sometext\\moretext", so the backslash is being escaped. However, when I debug the javascript line on the client side as it's being called I see that the viewId is being set to "sometextmoretext", with NO backslash at all in it.
I also tried wrapping the parameter in the server side in single quotes RunReport('{0}') but that didn't change the behavior. I feel like I'm overlooking something obvious, but can't quite figure it out.
Any help would be much appreciated.
Thanks!
Eddie