Tag Archives: ASP.Net

ASP.Net View State

ASP.Net View State. The extent of my knowledge up until this week consisted of:

  • It a base64 encoded string that exists in a hidden field in the page

There is apparently significantly more to this beast than that. I’m not going to re-hash it here, as there are some really good articles on it already. I highly recommend this article in particular. When combined with the MSDN ASP.Net Page Object help it gives an excellent picture of exactly where view state sits in the scheme of a web page, and it’s intented use. Continue reading

ASP.Net AJAX Auto Complete Control Extension

Today while working on adding tagging to items, I came across an issue with the auto complete control extender available in the ASP.Net AJAX Control library.

The problem is that you can’t host the extender in a custom user control (ascx file) and make it call back to a Page Method to retrieve the auto complete list. The reason for this is that the PageMethod() function in the javascript that is used to drive this functionality only hooks into the page itself, not the hosted control.
I’ve got a quick and dirty workaround for this, which works for me in the short term but I’m going to work on refining. It goes a little something like this… Continue reading

MaxLengthTextBox – AJAX Control Extender

If you’re looking for an easy way to apply a max length to an ASP.Net multiline text field, I’ve written a control extender that is compatable with IE, and Firefox. It uses .Net 3.5, and you’ll need to go here and grab the toolkit. Once you’ve done that, head here to grab the extender. Put a reference to the toolkit in your project, then reference the assembly I’ve provided.

Now all you should need to do is add the extender as per any normal extender. Set a max length for your text box, and you should be good to go!

If you’ve got any comments, suggestions, improvements or even ideas for other controls leave a message on the codeplex page, or here on the blog.

ASP.Net AJAX Extenders

As mentioned in my previous post it’s been quite a while since I last had the fortune to work on a web application. Today I discovered another gotcha for young players in the web world when trying to set the MaxLength property of a TextBox control. Normally this works fine, but if you combine this with settinig the style to MultiLine the world changes. Continue reading

Http Request Validation

Last week while working on what amounts to my first website in a very long time, I stumbled across something I hadn’t seen before. I was working on a bug that allowed the input of script tags into free text fields. This was causing the browser to pop up various HTTP 500 errors. The answer as to why, lay in the stack trace. Continue reading