<p>Is there a maximum length when using window.returnValue (variant) in a modal?  </p>

<p>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.</p>

<pre><code>Dim strReturn As New StringBuilder
strReturn.Append("&lt;script type=""text/javascript""&gt;window.returnValue='")
Dim strUsers As New StringBuilder
For Each dtRow As DataRow In GetSelectedUserTable.Rows
    If strUsers.ToString.Length &gt; 0 Then
        strUsers.Append(",")
    End If
    strUsers.Append(dtRow("UserID"))
Next
strReturn.Append(strUsers.ToString)
strReturn.Append("';window.close();&lt;/script&gt;")
litReturnJavascript.Text = strReturn.ToString
</code></pre>

<p>So would there be a limit on how many characters can be added to the window.returnValue?</p>

First, in what browser are you having problems?
```
window.returnValue
```
isn't even supported in Firefox, maybe not even other browsers.
Second, have you looked the value of
```
strUsers
```
after 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 and
```
window.opener
```
to set the value on the parent form instead - it is supported by more browsers. Just a suggestion...