When i was doing Classic ASP and PHP work for websites i didn’t really use anything more then GoLive or Dreamweaver and sometimes the ever handy Notepad. For the most part it was just the file management and the syntax highlighting i needed. Moving to .NET let me enter the world of IDEs outside of the classroom environment. I loved it, i learned a lot just by having intellisense show me options. It helped me explore a few things i never would have even known to try.
However, it also seems to have made me lazy. I just spent a good hour trying to figure out why my Linq to Sql classes i just set up weren’t working. I use the basic Add New -> Linq to Sql Classes and then just drag the tables i need and have it generate all the classes for me. EASY!
Well it turns out that this time it didn’t add the appropriate assembly to the webconfig. All that was missing was
<add assembly=”System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″/>
In some ways Visual Studio was vastly increased my speed in pumping out a web application, in others it has stunted my knowledge. I never had to create some of the things it does for me so i probably don’t fully understand what it is doing. Understanding this means i should probably poke around more often and see what its doing automatically in case i ever need to do it by hand. Sheesh.
General .NET, Visual Studio
If you’ve never had the pleasure of working jQuery, than you need to stop what you are doing and go check it out. Its a cool little JavaScript library that makes throwing some AJAX into your site a snap.
I’ve used jQuery Autocomplete before, and it generally looks something like this:
<script language=”javascript” >
$().ready(function() {
$(”.CLASSNAME”).autocomplete(JobTitles);
$(”#clear”).click(function() {
$(”:input”).unautocomplete();
});
});
</script>
Basically it takes my text box that i have set as class=”CLASSNAME” and in this example a javascript array called JOBTITLES and basically ’suggests’ values that match what they’ve type in so far. Very very handy tool.
I implemented it in a recent project where i was searching a list of names so people could easily search and select the name to add. I had this all wrapped up in an update panel that actually resides in a web user control and had multiple instances of it due to it being printed out in a repeated. Everything worked great….
Then i noticed after i signed up one of the names, my auto-complete broke, WTF? Turns out the update panel does a partial postback that breaks the jQuery. You can find out more information about that here and here.
So in the end i updated my code to look like this:
<script type=”text/javascript” language=”javascript” >
function pageLoad() {
$(”.CLASSNAME”).autocomplete(JOBTITLES);
$(”#clear”).click(function() {
$(”:input”).unautocomplete();
});
}
</script>
… and that did the trick!
Also found this article: $(document).ready() and pageLoad() are not the same!
General .NET, jQuery