Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Calling DHTML function from code behind event handler

Reply
Thread Tools

Calling DHTML function from code behind event handler

 
 
Lachlan Gemmell
Guest
Posts: n/a
 
      01-22-2004
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


 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      01-22-2004
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='private.php?do=newpm&u=?subject=C or demo&body=I hope this
helps?';"
End If
End Sub
///
I hope this helps a little bit?

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



 
Reply With Quote
 
 
 
 
Lachlan Gemmell
Guest
Posts: n/a
 
      01-23-2004
Thanks but it wasn't really what I was looking for. I found my solution in
the Page.RegisterClientScriptBlock() method.

Regards,

Lachlan


 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      01-23-2004
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
> Thanks but it wasn't really what I was looking for. I found my solution in
> the Page.RegisterClientScriptBlock() method.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Handler that creates adds another event handler kaczmar2@gmail.com ASP .Net 1 02-22-2007 07:37 AM
Calling a code behind function on onbeforeunload event lee_youjin@hotmail.com Javascript 1 09-25-2006 09:33 PM
Adding "onunload" JavaScript event handler to body in code-behind Laurent Bugnion ASP .Net 1 01-21-2006 09:53 PM
Do any DHTML books cover contemporary DHTML? Steve Javascript 1 04-09-2005 04:16 PM
Calling code-behind function from in-line code page Fred Armitage ASP .Net 2 08-26-2003 04:52 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57