Home All Groups Group Topic Archive Search About

Type Mismatch Error in showModalDialog Parameter

Author
25 May 2006 10:00 AM
sarithsutha
Hi,
The showModalDialog() function allows you to pass a value into the
dialog window. If the method is called from .net managed code and a
variable is passed to it, as opposed to a literal value like "hello",
accessing the dialogArguments property of the window object from within
the HTML page that is displayed with showModalDialog will result in a
type mismatch error.

Here is an example (in VB.net) that does not work.
'The oWindow in the example refers to html window object.

Dim Param1 As String
Param1 = "Hello"
oWindow.showModalDialog("Sample.html", Param1,
"status:no;dialogleft:190;dialogtop:170;dialogWidth:420px;dialogHeight:220px")

But the below mentioned example works
oWindow.showModalDialog("Sample.html", "Hello",
"status:no;dialogleft:190;dialogtop:170;dialogWidth:420px;dialogHeight:220px")

NOTE: There is a similiar bug, when used with VB Script, but that was
fixed in IE5. Check the KB article
http://support.microsoft.com/kb/q192114/ for more details.

Please let me know if there is a workaround or a patch that I can use.
Thanking you in advance.

Regards,
Sarith Sutha

Author
5 Jun 2006 7:02 AM
Sarith Sutha
Reposting it as no one responded.

sarithsu***@gmail.com wrote:
Show quote
> Hi,
> The showModalDialog() function allows you to pass a value into the
> dialog window. If the method is called from .net managed code and a
> variable is passed to it, as opposed to a literal value like "hello",
> accessing the dialogArguments property of the window object from within
> the HTML page that is displayed with showModalDialog will result in a
> type mismatch error.
>
> Here is an example (in VB.net) that does not work.
> 'The oWindow in the example refers to html window object.
>
> Dim Param1 As String
> Param1 = "Hello"
> oWindow.showModalDialog("Sample.html", Param1,
> "status:no;dialogleft:190;dialogtop:170;dialogWidth:420px;dialogHeight:220px")
>
> But the below mentioned example works
> oWindow.showModalDialog("Sample.html", "Hello",
> "status:no;dialogleft:190;dialogtop:170;dialogWidth:420px;dialogHeight:220px")
>
> NOTE: There is a similiar bug, when used with VB Script, but that was
> fixed in IE5. Check the KB article
> http://support.microsoft.com/kb/q192114/ for more details.
>
> Please let me know if there is a workaround or a patch that I can use.
> Thanking you in advance.
>
> Regards,
> Sarith Sutha

AddThis Social Bookmark Button