Tech and a few other things RSS 2.0
# Sunday, October 24, 2010


Problem:
When I look for the id of an ASP.NET element with some sort of neat DOM querying language I can't find it.

Solution:
Remember ASP.NETer's ASP.NET renames the id from what you named it to something different when it writes the element out to the page. The good news is ASP.NET always names it to the same unique name (something like but not necessarily  ctl00_classname_controlname). Knowing this, you can run your page once and grab the id from the page source. Now use your super cool DOM querying language of choice to find that id by it's new proper ASP.NET name.

Explanation:
Why does ASP.NET do this? The good super geeks at Microsoft know that most of us, not you the reader of course, are not wise enough to give each ASP.NET element a unique name so they won't conflict with each other when ASP.NET is doing all its little magic tricks.

Once again this is a stupid little error that hung me up for more than I'd like to admit. I knew ASP.NET did this I just didn't piece together on why I couldn't find the element by id with my querying language.

Sunday, October 24, 2010 10:22:51 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
.Net | dojo | JQuery | Microsoft AJAX
Navigation
About the author/Disclaimer
        

My name is Ben Coffman. Currently leading the release of Mobile into Canada for Capital One. I have a strong focus on mobile development, building effective development teams and a drive for rapid prototyping and continuous integration using nearly all SDLCs. When I turn the internet off I focus on my family, random hobbies, and sharing moments in life.

My pseudo provactive thoughts
--> Twitter @coffmanben

Learn About Me
--> Linkedin

Blogs I follow:
  1. Big Nerd Ranch
  2. Jeff Lamarche
  3. Scott Hanselman

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Ben Coffman

Archive
<May 2013>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
All Content © 2013,

Sign In