Is there a maximum length when using window.returnValue (variant) in a modal?
I am calling a modal window using showModalDialog() and returning a comma delimited string. After selecting a group of users, I am putting them into a stringbuilder to display in a literal.
Dim strReturn As New StringBuilder strReturn.Append('<script type=''text/javascript''>window.returnValue='') Dim strUsers As New StringBuilder For Each dtRow As DataRow In GetSelectedUserTable.Rows If strUsers.ToString.Length > 0 Then strUsers.Append(',') End If strUsers.Append(dtRow('UserID')) Next strReturn.Append(strUsers.ToString) strReturn.Append('';window.close();</script>') litReturnJavascript.Text = strReturn.ToString
So would there be a limit on how many characters can be added to the window.returnValue?
First, in what browser are you having problems?
window.returnValueisn’t even supported in Firefox, maybe not even other browsers.Second, have you looked the value of
strUsersafter building it to make sure there are no single or double quotes in that string?I would guess that the maximum size/length of that property would be determined more by your system’s memory than anything else.
EDIT: Maybe you should look at using
window.open()to open a new window andwindow.openerto set the value on the parent form instead – it is supported by more browsers. Just a suggestion…