473,799 Members | 3,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp.Net SS control call client java function

Can an asp.net button that is a server side control call a client side java
function when the button is clicked? If so, please provide
example.....tha nks.,

Nov 19 '05 #1
4 1233
In code:

button1.Attribu tes.Add("onClic k" , " doSomething()") ;

doSometing() is your Javascript function

I would write this code probably in the page load event.

"Mike Moore" <Mi*******@disc ussions.microso ft.com> wrote in message
news:E6******** *************** ***********@mic rosoft.com...
Can an asp.net button that is a server side control call a client side
java
function when the button is clicked? If so, please provide
example.....tha nks.,

Nov 19 '05 #2
To register the client side JavaScript (example):

Private Sub Page_Load(sende r as Object, e as EventArgs) Handles MyBase.Load
....
ClientScriptKBa se()
....
End Sub

....

Private Sub ClientScriptKBa se()
'Register JavaScript block for KBase button (HTML Control)
Dim JavaScriptCode as String = "<SCRIPT language='JavaS cript'
type='text/javascript'><!--"& vbCRLF _
&"function KBase()"& vbCRLF _
&"{"& vbCRLF _
&"
window.open('../KBase/KBase.aspx','wi n_KBase','statu s=1,resizable=1 ,alwaysRa
ised=1,left=0,t op=0,height=' + (screen.availHe ight - 110) + ',width=' +
(screen.availWi dth - 10));"& vbCRLF _
&"} //--> </SCRIPT>"& vbCRLF

If NOT(IsClientScr iptBlockRegiste red("KBase")) Then
RegisterClientS criptBlock("KBa se", JavaScriptCode)
End If
End Sub

"Mike Moore" <Mi*******@disc ussions.microso ft.com> wrote in message
news:E6******** *************** ***********@mic rosoft.com...
Can an asp.net button that is a server side control call a client side java function when the button is clicked? If so, please provide
example.....tha nks.,

Nov 19 '05 #3
"Mike Moore" <Mi*******@disc ussions.microso ft.com> wrote in message
news:E6******** *************** ***********@mic rosoft.com...
Can an asp.net button that is a server side control call a client side
java
function when the button is clicked? If so, please provide
example.....tha nks.,


I use the following for my popups:

Dim myDeleteButton As LinkButton
myDeleteButton = e.Item.FindCont rol("btnDelete" )
myDeleteButton. Attributes.Add( "onclick", "return confirm('Are you sure
you want to delete this answer?');")

Tom
Nov 19 '05 #4
Hope we are reading your question correctly, do you mean client side
javascript or java ?

"Mike Moore" <Mi*******@disc ussions.microso ft.com> wrote in message
news:E6******** *************** ***********@mic rosoft.com...
Can an asp.net button that is a server side control call a client side
java
function when the button is clicked? If so, please provide
example.....tha nks.,

Nov 19 '05 #5

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

Similar topics

1
1442
by: Mike Moore | last post by:
Can an asp.net button that is a server side control call a client side java function when the button is clicked? If so, please provide example.....thanks.,
16
2127
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is very broad and gives the entire zone high privleges. I tried giving just the assembly full trust (using the full URL for the DLL), but this doesn't seem to work.
4
4482
by: Barb | last post by:
I have a user control as my Save button for my page. When the Save button is clicked, I want some client-side validation to take place from a javascript function in the page, and then I'd like the server event to fire to update the database. I've successfully done this with a normal webcontrol via: myControl.Attributes("onclick") = "javascript:alert('You clicked me!!');" In that case, myControl is an asp:button on the page. In the...
3
2081
by: Ant | last post by:
I'm building a Web user control that has several public functions. Can I fire them from the client side? for example Javascript and an HTML button
4
4124
by: Rob Shorney | last post by:
Hi, I am using .Net 2003 , c# asp.net. The situation i have is this. I have a asp.net page which in the codebehind maintains an xml document in memory. The user can click on a button to popup a windows to select some items, this is done via window.open, I then return the selected items via the returnValue, when I receive the data back I need to be able to call into a function in my main page codebehind to update the xml.
2
2005
by: Shawn | last post by:
Hi. I've never created an ActiveX control before, so I know little about what it is capable of and what its limitations are. My problem is this: I have to create a way to send multiple documents from the web server to a printer on the user's network. The way it works today the user has to manually download each document and send it to his printer, but now they want me to create an automated process. Will I be able to download documents...
7
2552
by: J-T | last post by:
I have a user control called "Test1" with two button on it ,one is input and the other one is a server control as follow: <input type="button" onClick="this.disabled=true;document.getElementById(btnSend).click();value="Go!"> <asp:button id="btnSend" runat="server" onClick="click" Width="90px" Text="HiddenControl" Visible="False"></asp:button> As you can see the asp.net button is calling a java script function as follows:
7
22030
by: walter | last post by:
Here is my case : I create a user control which contains One checkbox control to enable/disable the other two textbox control. I'm using server control instead of HTML control, and I don't want to post back to server to do the disable. The problem is I there is no easy way for me to find the ID in the javascript since the ID or name are all prefixed with parent name. Even worse, this control could be wrapped with another user control...
4
1428
by: =?Utf-8?B?S2F1c2hhbCBNZWh0YQ==?= | last post by:
Hi, I was reading about asynchronous transfer of control in Real Time Java Specification. I am wondering if there is any way we can do similar thing with Web Services in Service Oriented Architecture. Please let me know your opinion.
0
9688
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
10260
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
9078
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
7570
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
6809
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();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.