473,563 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

aspx web form controls and client side java script

Hi all

Is it possible to handle web controls events on client side???

I wrote a simple favascript function inside the <header> area of an aspx
web form.
This function is called on selectedIndexCh anged event of server side radio
button list,
but i can not get there . During compilation, it seems like the dotnet asp
service is looking for this function on that web form's (server side) code
behind instead
(this control's autoPostBack property is also set to false).
Am i right??

If so should i use regular html controls when i need to handle events on
client side?

I'm not sure i understand the advantage of using server side controls if
this is the case..
Nov 18 '05 #1
2 1942
Assuming your DropDownList is ddl1, add this in your Page_Load():

ddl1.Attributes .Add("onchange" , "myJavaScriptMe thod(this)");

That'll do it for you.

Dale Preston
MCAD, MCSE, MCDBA
"Rea Peleg" <re******@bar ak-online.net> wrote in message
news:ev******** *****@TK2MSFTNG P12.phx.gbl...
Hi all

Is it possible to handle web controls events on client side???

I wrote a simple favascript function inside the <header> area of an aspx
web form.
This function is called on selectedIndexCh anged event of server side radio
button list,
but i can not get there . During compilation, it seems like the dotnet asp
service is looking for this function on that web form's (server side) code
behind instead
(this control's autoPostBack property is also set to false).
Am i right??

If so should i use regular html controls when i need to handle events on
client side?

I'm not sure i understand the advantage of using server side controls if
this is the case..

Nov 18 '05 #2
Rea,
You don't need server controls in all cases. If you are populating the
combo box programmaticall y, then it'll need to be a server control. If not,
then just make it a regular html control and set onchange="myFun c(this);",
but if it's a server control, then follow Dale's suggestion. This puts that
onchange attribute there for you.

Best regards,
Jeffrey Palermo

"Dale" <da************ @msndotcomNot.N et> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
Assuming your DropDownList is ddl1, add this in your Page_Load():

ddl1.Attributes .Add("onchange" , "myJavaScriptMe thod(this)");

That'll do it for you.

Dale Preston
MCAD, MCSE, MCDBA
"Rea Peleg" <re******@bar ak-online.net> wrote in message
news:ev******** *****@TK2MSFTNG P12.phx.gbl...
Hi all

Is it possible to handle web controls events on client side???

I wrote a simple favascript function inside the <header> area of an aspx web form.
This function is called on selectedIndexCh anged event of server side radio button list,
but i can not get there . During compilation, it seems like the dotnet asp service is looking for this function on that web form's (server side) code behind instead
(this control's autoPostBack property is also set to false).
Am i right??

If so should i use regular html controls when i need to handle events on
client side?

I'm not sure i understand the advantage of using server side controls if
this is the case..


Nov 18 '05 #3

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

Similar topics

5
4249
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the second form when it is called. Both forms are .htm files that call themselves when the submit button is press via the following command in each form:...
19
2974
by: Pete | last post by:
I have form/select which executes a function using onchange. No problem. However, when I validate the page with a strict HTML 4.01 doctype at http://validator.w3.org, it demands either an action or a method for the form?. If I give it an empty action <form action="" ..... it validates OK. Is this acceptable or is there a better/standards...
5
1964
by: tmb | last post by:
Is there a way to use ASP to 'push' a new image to the client every 15 seconds or so? I guess the entire page will have to be 're-sent' to the client but I'm not sure. I'm trying to 'rotate' a new product image every few seconds. I could use an animated gif or some java script maybe, but I want to keep the file small and not have to...
3
3955
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then IsPostBack=False by now!. The ASPX is opened via client side script (into an iFrame) inside a .HTM file (as ASPX postback causes problems in a modal...
2
1246
by: aspquest | last post by:
Hi All I have a web form page (page1.aspx) which has an iframe, and the src of the iframe is set to another web form page (page2.aspx). I would like to access the values of the server controls on page2.aspx from the parent page1.aspx. Is it possible ? Thanks in advance
2
1631
by: kermit | last post by:
I have a .net aspx page MyPage.aspx (client side) with code behind MyPage.aspx.vb (server side). I use the Page_Load event in MyPage.aspx.vb to load data into a multiteir class based collection. MyCollection(sYear).cMonths(sMonth).cDays(sDay).cEvents(sID).EventText My problem arrives when I try to access this collection from the...
6
1829
by: John Rivers | last post by:
hi, here is how to do it and restore sanity to aspx html rendering: (please only reply with sensible architectural discussion - juan) put this at the end of an aspx file (or use an include at the end if you want to reuse it on many aspx pages) (notice closing brace) (start) <%}
13
3531
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains some javascript code that calls window.open. I pass the resource url of page B to Page A's window.open call. Page B is then loaded and executed but...
5
13107
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called this kind of script "Server Side Java Script". I am in confusion because according to lots of web developer Java Script is a client side scripting...
0
7583
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...
0
8106
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...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
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...
0
5213
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...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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
1
1200
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.