Modal Dialog Popup from WebControl - What is wrong with this...

  • Thread starter Thread starter Bob Lehmann
  • Start date Start date
B

Bob Lehmann

http://www.aspfaq.com/show.asp?id=2257


Jim Mitchell said:
I saw several posts asking for popups from web controls. The standard
answer is that once rendered, the server no longer has control. I had some
success with the following and I was curious if I have broken any rules.

Add this line to the load_page event....

Response.Write("<script language=javascript>function CallSub(passed_value)
{temp=showModalDialog('http://www.cnn.com?PVAL' +
 
I saw several posts asking for popups from web controls. The standard
answer is that once rendered, the server no longer has control. I had
some success with the following and I was curious if I have broken any
rules.

Add this line to the load_page event....

Response.Write("<script language=javascript>function
CallSub(passed_value) {temp=showModalDialog('http://www.cnn.com?PVAL'
+ passed_value)}</script>")

In your datagrid, set the following fields for a linkbutton......

URL: javascript:CallSub()
URL FIELD: ID ...... id is the record
id URL FORMAT STRING: javascript:CallSub({0})

The result seems to be a server side control that calls a popup. The
popup could call an HTTPPOST to write data to the database before
closing the window.

Any reason why this should not or would not work? So far it seems to
work for me.

Before posting, please fix your computers date. It's not really August 22
there is it?
 
People who set their date to a future date so that their message will stay
at the top of the thread should have to find their own answers.
 
I too often use my date and time as a calendar and then just click OK at the
end of the day. Sorry. You would think Microsoft could purge the
newsgroup?
 
I saw several posts asking for popups from web controls. The standard
answer is that once rendered, the server no longer has control. I had some
success with the following and I was curious if I have broken any rules.

Add this line to the load_page event....

Response.Write("<script language=javascript>function CallSub(passed_value)
{temp=showModalDialog('http://www.cnn.com?PVAL' + passed_value)}</script>")

In your datagrid, set the following fields for a linkbutton......

URL: javascript:CallSub()
URL FIELD: ID ...... id is the record id
URL FORMAT STRING: javascript:CallSub({0})

The result seems to be a server side control that calls a popup. The popup
could call an HTTPPOST to write data to the database before closing the
window.

Any reason why this should not or would not work? So far it seems to work
for me.
 
Back
Top