A
Al Cadalzo
I want to respond to a submit button click on a form by writing to a
database then display a popup confirmation window that just has a 'Success'
message and an OK button on it that returns the user to the form.
I've been playing with the RegisterStartupScript method to register my
javascript that opens a modal window that has the 'success' message. I'm
creating the <script language=javascript> block just fine. It contains a
function ShowConfirm(). How do I dynamically set the OnLoad attribute of
the <body> element to "javascript: ShowConfirm()" so that the confirmation
window displays after I do my processing in the OnClick event handler of my
button?
I'm using this code:
DirectCast(Me.FindControl("Body"),
HtmlContainerControl).Attributes("OnLoad") = "javascript:ShowConfirm()"
Is this the best way? Any suggestions?
Thanks,
Al
database then display a popup confirmation window that just has a 'Success'
message and an OK button on it that returns the user to the form.
I've been playing with the RegisterStartupScript method to register my
javascript that opens a modal window that has the 'success' message. I'm
creating the <script language=javascript> block just fine. It contains a
function ShowConfirm(). How do I dynamically set the OnLoad attribute of
the <body> element to "javascript: ShowConfirm()" so that the confirmation
window displays after I do my processing in the OnClick event handler of my
button?
I'm using this code:
DirectCast(Me.FindControl("Body"),
HtmlContainerControl).Attributes("OnLoad") = "javascript:ShowConfirm()"
Is this the best way? Any suggestions?
Thanks,
Al