473,394 Members | 1,748 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,394 software developers and data experts.

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.....thanks.,

Nov 19 '05 #1
4 1215
In code:

button1.Attributes.Add("onClick" , " doSomething()");

doSometing() is your Javascript function

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

"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.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.....thanks.,

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

Private Sub Page_Load(sender as Object, e as EventArgs) Handles MyBase.Load
....
ClientScriptKBase()
....
End Sub

....

Private Sub ClientScriptKBase()
'Register JavaScript block for KBase button (HTML Control)
Dim JavaScriptCode as String = "<SCRIPT language='JavaScript'
type='text/javascript'><!--"& vbCRLF _
&"function KBase()"& vbCRLF _
&"{"& vbCRLF _
&"
window.open('../KBase/KBase.aspx','win_KBase','status=1,resizable=1,alwa ysRa
ised=1,left=0,top=0,height=' + (screen.availHeight - 110) + ',width=' +
(screen.availWidth - 10));"& vbCRLF _
&"} //--> </SCRIPT>"& vbCRLF

If NOT(IsClientScriptBlockRegistered("KBase")) Then
RegisterClientScriptBlock("KBase", JavaScriptCode)
End If
End Sub

"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.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.....thanks.,

Nov 19 '05 #3
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.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.....thanks.,


I use the following for my popups:

Dim myDeleteButton As LinkButton
myDeleteButton = e.Item.FindControl("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*******@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.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.....thanks.,

Nov 19 '05 #5

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

Similar topics

1
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
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...
4
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...
3
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
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...
2
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...
7
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"...
7
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.