Client Scripting: ASP.NET attributes vs. all the rest of the attributes

I had a conversation with a friend who is new to web development and is doing an ASP.NET application. She came upon a roadblock that I recall made me nuts two years ago. She wanted to grab an onclick event on a server control in the client side script. If you are coding in the html, this is not presented as an option and  if you choose to bypass that and enter onclick anyway, you get the little squiggly line and a tooltip saying that this attribute doesn’t exist. If you are bold enough to ignore that, you will find that it works anyway. But she got stopped by what the intellisense told her was not possible.

There is a whole world of client side scripting that many people will never realize exists because they depend on the guidance of intellisense. She also spent some time googling and researching and got very frustrated because she felt that she was being led to the conclusion that you can’t interact with server controls in client script. I know there are lots of resources, but this is the experience of someone who is very capable and not lazy about researching information. So if this was what she came up with, I am sure that many others do the same.

I was a windows developer fairly new to web stuff when I started ASP.NET, so I understood completely where she is coming from. I told her that she can ignore that intellisense when working in the client side html of her webforms and  pointed her to one of my favorite resources for when I have to deal with anything on the clientside: DevEdge.Netscape.com. I have pointed this out before. In there you can find this great javascript reference and this morning the key chapter was Chapter 3 on event handlers.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.