Exposing Child Control Events In A User Control

Sometimes we want to add handlers to events raised by children of a User Control. As far as I could google these are your options. 1. The  simplest way is to provide an accessor method that returns the control. Chances are if you only expose certain properties of your child control, develo... [More]

Reference Custom Controls Located In App_Code Folder

You can add references to assembly namespaces in your web.config to avoid having to register controls on every .aspx in your web site: [code:xml] <system.web>     <pages>         <controls>       &... [More]

Ping In C# .Net

This is probably old news to most people but I ended up googling for it so I'll record it here. Since .Net 2.0 there is a handy Ping class in the System.Net.NetworkInformation namespace that encapsulates - you guessed it - ping functionality. Here's some example code for performing a synch... [More]

Running ASP.Net AJAX And The Ajax Control Toolkit From Javascript Source In .Net 2.0

I've found myself in need of debugging the javascript for the Ajax toolkit controls (AjaxCotnrolToolkit.dll) and in some cases the ASP.Net AJAX libraries. Here's how to set up an existing ajax-enabled web site to run from source code. This is intended for people using the Ajax framework... [More]

Hashed or Encrypted Passwords Are Not Supported With Auto-generated Keys - Custom Membership Provider

I got this error when implementing a custom membership provider for which I grabbed the code from this MSDN article.   When I tried to login through ASP.Net's Login control I got the following error:   "Hashed or Encrypted passwords are not supported with auto-generated keys... [More]

Paypal Donate Button Doesn't Open In ASP.Net Web site

The html code that Paypal provides for donate buttons doesn't work when inserted directly into an ASP.Net web form. Because the Paypal form is nested inside the main <form> tag, when we click the button the page posts back to itself and effectively just refreshes. One way to get arou... [More]

An Incremental TextBox With The Help Of ASP.Net Ajax Controls

In a recent web project I had a requirement for incremental searching - for each character entered into a text box we need to call a search function on the server and update a list displayed in a div in the browser. ASP.Net and a bit of Ajax makes this task quite simple. Calling The Server-Si... [More]

Sys.ArgumentNullException: Value cannot be null. Parameter name: postBackElement

Update: After looking into this a bit further I found the problem doesn't exist in the Microsoft Ajax Library 3.5 (the same library bundled with ASP.Net 3.5). The same fix I propose here is implemented in that version...go me! Bill Gates must read my blog ;-P. So if you can upgrade, go for tha... [More]

ASP.Net ImageButton Shows 'Submit Query' And Doesn't Vertically Align With TextBox

ImageButton Shows the Ugly 'Submit Query' Text This was happening for me when I was setting the background image of the button using CSS. If you don't specify the ImageUrl attribute (or the value is empty string) 'Submit Query' will be shown. So the simple fix is to make sure ... [More]

document.activeElement in Firefox - Finding The Element That Has Focus

Internet Explorer has a handy 'activeElement' property on the document object which keeps track of the current element that has focus. Firefox 3 is going to support the same property inline with the HTML 5 specification but that's a fair way off so here's a work around: [co... [More]
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010