.NETGURU
aspx web form controls and client side java script
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.jscript.

Post a new message to this list...

Rea Peleg
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..

Reply to this message...
 
    
bruce barker
the OnClick for asp.net server is a serverside event. to catch client events
use the "onclick" attribute. note some server controls are really a span
with children, so the event will be on the span.

-- bruce (sqlwork.com)

"Rea Peleg" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Rea Peleg
Thanks bruce
I tried the attribute trick but it would not work for asp controls.
Just for html ones..
Any thing i may be missing here?
Also i did not understand the concept of span control?
Thanks again
Rea

"bruce barker" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> the OnClick for asp.net server is a serverside event. to catch client
events
[Original message clipped]

Reply to this message...
 
    
bruce barker
to understand webserver controls from the client side, you have to look at
the html rendered. some server controls render themselves inside a span,
which is rendered with the control id. setting additional properties of
attributes will be rendered on the span, not the containing control.

in the case of a radio list, a html table is rendered with the control id,
and radio controls inside rows. setting the attributes of the server
control will set properties on the table. there is no client side equilvant
to selectedIndexChanged. you could attach onclick or onchange handlers to
the radio controls to figure it out. you would have to client script to find
and attach the handlers though.

-- bruce (sqlwork.com)

"Rea Peleg" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification