ASP.NET Ajax Client Library

  • Thread starter Thread starter MAX2006
  • Start date Start date
M

MAX2006

Hi,

How can I use Client Library to add an event handler to all text boxes
within a page?

I already googled it. A link to an online resource or sample would be a
great help.

Thank you,
Max
 
jQuery is better at this than the ms ajax library. but its something like:


var nodes = document.getElementsByTagName("INPUT")
foreach (var node in nodes)
{
if (node.type.toUpperCase() == "TEXT")
$addHandler(node,"click",myHandler);
}

-- bruce (sqlwork.com)
 
Hi Max,

As Bruce's suggested, what you need to do here is

1. Use javascript to enumerate all the TextBox DOM elements on the page(in
client script):

2. Call ASP.NET ajax "$addhandler" function to register client-side event
handler for each of the enumerated element.

In addition, here are some tutorial and reference links for using
"addhandler" and some of the other AJAX client feature:

#Sys.UI.DomEvent addHandler Method
http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys.UI/DomEventCl
ass/SysUIDomEventAddHandlerMethod.aspx

#ASP.NET AJAX Control Development
http://dotnetslackers.com/articles/ajax/ASPNETAJAXControlDevelopment.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
 
Hi MAX,

Have you got any further ideas or still need any help on this?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Wed, 27 Aug 2008 03:05:30 GMT
Subject: RE: ASP.NET Ajax Client Library
 
Back
Top