Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report error using pop up box

Status
Not open for further replies.

s2001

Programmer
Dec 7, 2001
132
US
Hello all,

I have a proceedure that does a task. I want to pop up a message once the task is over...can't figure out how..

Private sub DoTask()
try
'do the work
'show the message - ShowMessageBox("All process completed.")
catch ex as exception
'Report error
'ShowMessageBox(ex.message)
end try

I tried calling the following sub. But it does not work.

Public Sub ShowMessageBox(ByVal strMessage As String, ByRef aspxpage As System.Web.UI.Page)

Dim strScript As String

strScript = "<script language=JavaScript>"
strScript += "alert(""" & strMessage & """); "
strScript += "</script>"

If (Not aspxpage.IsStartupScriptRegistered("ClientScript")) Then
aspxpage.RegisterStartupScript("ClientScript", strScript)
End If

End Sub


Any ideas.


Thanks,
MB
 
well, if you really want to display the message in a popup window then you are on the right path by using java. I would look into the java window.open method.

But why would you want to display the error on a different page? I don't think you would be able to stop the error from showing on the "Parent" page. so it would display in both pages(I could be wrong). You could also pass the error message to a session and pass that session to the popup. that's probably not the best way.

 
What's not working? I just did a quick test with your code and it worked for me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top