calling javascript function from code-behind page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my DeleteButton_OnDelete method I would like to get confirmation from the
user as to whether they are sure they want to delete a member. How do I call
a js routine to confirm the choice?
 
Bill,

You can add an attribute to a control, that shows a message.
\\\
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Me.Button1.Text = "Send Mail"
Me.Button1.Attributes("onClick") =
"window.location='mailto:[email protected]?subject=Cor demo&body=I hope this
helps?';"
End If
End Sub
///
You can call just a javascript
\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///

However I would create in this situation an extra label on the form and use
that to show the message while I can than use the button again to confirm
because I have than set the status in a session.item

I hope this helps,

Cor
 
Back
Top