473,320 Members | 2,088 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,320 software developers and data experts.

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 selectedIndexChanged 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 1935
Assuming your DropDownList is ddl1, add this in your Page_Load():

ddl1.Attributes.Add("onchange", "myJavaScriptMethod(this)");

That'll do it for you.

Dale Preston
MCAD, MCSE, MCDBA
"Rea Peleg" <re******@barak-online.net> wrote in message
news:ev*************@TK2MSFTNGP12.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 selectedIndexChanged 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 programmatically, then it'll need to be a server control. If not,
then just make it a regular html control and set onchange="myFunc(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.Net> wrote in message
news:u$**************@TK2MSFTNGP10.phx.gbl...
Assuming your DropDownList is ddl1, add this in your Page_Load():

ddl1.Attributes.Add("onchange", "myJavaScriptMethod(this)");

That'll do it for you.

Dale Preston
MCAD, MCSE, MCDBA
"Rea Peleg" <re******@barak-online.net> wrote in message
news:ev*************@TK2MSFTNGP12.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 selectedIndexChanged 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
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...
19
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...
5
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'...
3
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...
2
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...
2
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...
6
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...
13
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...
5
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.