473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Calling DHTML function from code behind event handler

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
Nov 18 '05 #1
3 1268
Cor
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:no*@non.com?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?

Nov 18 '05 #2
Thanks but it wasn't really what I was looking for. I found my solution in
the Page.RegisterClientScriptBlock() method.

Regards,

Lachlan
Nov 18 '05 #3
Cor
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.

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
6
by: vbMark | last post by:
If I have a control, for example a CheckedListBox, how do I add and event to code, for example that a box has been checked by the user? Thanks
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
5
by: Columbia Pike | last post by:
Hi, I'm trying to have a login page; after logging in the user has to see the list of SQL Server Databases available to him/her. I'm always getting the error 'ASP.login_aspx' does not contain a...
4
by: Peter Bons | last post by:
Hi all, I have an asp.net page with a button that has a javascript onclick method attached to it to display a modal dialog like this: If reportHasParameters Then 'add client side onclick()...
2
by: M B HONG 20 | last post by:
Hi all - I am developing an ASP.NET (C#) application and need some help. I wish to call a server-side function (in the code-behind "file.aspx.cs") upon a user clicking on the "X" to close the...
3
by: Jason | last post by:
I have an ASP.NET application in which I would like to call my button click event (imgSubmitSearch_Click) on the page load if certain criteria are met. Is this possible? What is the correct...
22
by: DL | last post by:
Hi, What I wanted to do is to call a function from a newly created element. But it stumbled me. Here's the line that references the newly created element and I used the alert function for...
9
by: Pubs | last post by:
Hi all, I want to call a function with some intial parameters with in a thread. At the end of the function execution it should return a value to the caller. Caller is outside the thread. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.