Calling DHTML function from code behind event handler

  • Thread starter Thread starter Lachlan Gemmell
  • Start date Start date
L

Lachlan Gemmell

Hello there,

I'm hoping this is possible but as yet I haven't been able to find out how
to do it.

I have placed a client side VBScript function in the HTML of my ASP.NET
page. Only under certain circumstances I want a server side button click
event handler in my code behind class to trigger a call of that VBScript
function. I understand that the call will not be made at the time the server
side button click event handler but instead will execute later when the page
is rendered on the client.

How do I accomplish this?

Regards,

Lachlan
 
Lachlan,

Try this

\\\needs a button on a webpage
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
///
I hope this helps a little bit?

Cor
 
Thanks but it wasn't really what I was looking for. I found my solution in
the Page.RegisterClientScriptBlock() method.

Regards,

Lachlan
 
You mean this one?
\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///
I thought your question had to do with the click event?

Cor
 
Back
Top