Hi,
on my baseform 'FormLoggedIn.aspx' I've added a Button with:
Button2.Attributes.Add("onclick",
"window.showModalDialog('WebForm3.aspx',Null
,'status:no;dialogWidth:370px;dialogHeight:720px;dialogHide:false;help:no;scroll:Yes');")

When the user click on the button webform3 is loaded, exactly how I like it.
But on Webform3 I've implemented a customservercontrol with several events
depending on the users input.

When such an event fires (server site) a new form is loaded in stead of
updating the existing form. The result of the event took place in the new
opend form.

But when I use:

Button2.Attributes.Add("onclick", "window.open ('WebForm3.aspx')")

everythings works fine, allthough the form is not a modal form.

Is something wrong with the parameters of the showModalDialog?



Please reply



Ton

Re: showModalDialog and customservercontrols by Michael

Michael
Thu Sep 15 21:21:15 CDT 2005

ton wrote:
> Hi,
> on my baseform 'FormLoggedIn.aspx' I've added a Button with:
> Button2.Attributes.Add("onclick",
> "window.showModalDialog('WebForm3.aspx',Null
> ,'status:no;dialogWidth:370px;dialogHeight:720px;dialogHide:false;help:no;scroll:Yes');")
>
> When the user click on the button webform3 is loaded, exactly how I
> like it. But on Webform3 I've implemented a customservercontrol with
> several events depending on the users input.
>
> When such an event fires (server site) a new form is loaded in stead
> of updating the existing form. The result of the event took place in
> the new opend form.
>
> But when I use:
>
> Button2.Attributes.Add("onclick", "window.open ('WebForm3.aspx')")
>
> everythings works fine, allthough the form is not a modal form.
>
> Is something wrong with the parameters of the showModalDialog?
>

Modal dialog windows are not intended to host pages with forms that post
back to themselves.

Create a wrapper page to pass to showModalDialog (single frame frameset or a
page with a single iframe) and display the form page inside the frame/iframe
in the wrapper page. If you need to reference the wrapper page's window
object, use top.window from within the framed (form) page.


--
Michael Harris
Microsoft MVP Scripting