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

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' +
 
C

Chris Dunaway

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?
 
S

Scott M.

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.
 
J

Jim Mitchell

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?
 
J

Jim Mitchell

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.
 

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,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top