open webform with client script but cant close it

T

ton

Hi,

I 've a problem. Consider 2 webforms
webform1 got a button: in the Page_Load event, this code:

Button1.Attributes.Add("onclick",
"window.showModalDialog('webform2.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');")

the 2nd form got a button2 in the Page_Load event, this code:

Button2.Attributes.Add("onclick", "window.close();")

what happens is that the second dialog is a nice pop-up, but after closing
it is closed and RELOADED again (but then not as modal form and not in the
specified height/width

What am I doing wrong??


Ton
 
T

ton

WOUW

it worked great thanks

Ton

Eliyahu Goldin said:
Add this line to the <head> section of the page you open as a modal
dialog:

<base target="_self"/>

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


ton said:
Hi,

I 've a problem. Consider 2 webforms
webform1 got a button: in the Page_Load event, this code:

Button1.Attributes.Add("onclick",
"window.showModalDialog('webform2.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');")

the 2nd form got a button2 in the Page_Load event, this code:

Button2.Attributes.Add("onclick", "window.close();")

what happens is that the second dialog is a nice pop-up, but after
closing
it is closed and RELOADED again (but then not as modal form and not in
the
specified height/width

What am I doing wrong??


Ton
 
B

bruce barker

as noted, the webform events are only fired by an async postback. control
extenders just subscribe to generic browser events (onclick, onfocus, etc),
so there is no generic tell me when you are done.

but some extenders will fire events your javascript can subscribe to. the
auto complete has several events (just look at the javascript code, the best
documentation). for autocomplete, maybe populated (fired after list is
loaded) is the event you want, not sure what you are trying to do.

-- bruce (sqlwork.com)
 
S

siccolo

as noted, the webform events are only fired by an async postback. control
extenders just subscribe to generic browser events (onclick, onfocus, etc),
so there is no generic tell me when you are done.

but some extenders will fire  events your javascript can subscribe to. the
auto complete has several events (just look at the javascript code, the best
documentation).  for autocomplete, maybe populated (fired after list is
loaded) is the event you want, not sure what you are trying to do.

-- bruce (sqlwork.com)










- Show quoted text -

sometimes, it also helps to show second web form in a iframe....


... more at http://www.siccolo.com/articles.asp...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top