473,698 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1275
Cor
Lachlan,

Try this

\\\needs a button on a webpage
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Me.Button1.Text = "Send Mail"
Me.Button1.Attr ibutes("onClick ") = _
"window.locatio n='mailto:no*@n on.com?subject= Cor 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.RegisterCl ientScriptBlock () method.

Regards,

Lachlan
Nov 18 '05 #3
Cor
You mean this one?
\\\
Dim str As String
str = "<script language=javasc ript> {window.open('h ttp://www.google.com' );}
</script>"
RegisterStartup Script("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.RegisterCl ientScriptBlock () method.

Nov 18 '05 #4

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

Similar topics

2
7674
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 like mine to run immediately after it. So in the code below, what JS would i need to add to my "myfile.inc" page so that I could guarantee this behavior? <!-- main page --> <html> <head> <script type="text/javascript">
6
1873
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
4081
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 dependant on data collected in the code behind on the server. I have set AutoPostback to false for the controls and added lines such as cboMyCombo1.Attributes.Add("onchange", "MyCombos_OnChange('1')"); in the Page_Load event, which is rendered OK...
5
8725
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 definition for 'btnSignIn_Click' I have the btnSignIn_Click function defined in a codebehind .cs file - The file name is Connect.aspx.cs. I made a DLL and have that DLL in the Bin subfolder (Bin\Connect.dll). Here's the command I used for...
4
2278
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() event handler to display the popup dialog for entering parametervalues btnChangeParameters.Attributes.Add("onclick", String.Format("window.showModalDialog
2
5757
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 browser window. Is there a way to postback and call a server-side function when this happens? I am aware of the browser's native "onunload" event, but am not certain that what I'm looking for is actually possible. Any help would be greatly...
3
4247
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 syntax to be able to programmatically have my imgSubmitSearch button clicked? I tried the obvious, Call imgSubmitSearch, but intellisense doesn't like that due to the sender / e arguments. Private Sub imgSubmitSearch_Click(ByVal sender As...
22
1686
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 debugging for now. Did I mess up all these quotes? // once again this is the key line of code, problem area, disregard
9
3251
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. Example function test (int a, int b);
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.