Unable to cast object of type 'System.Web.UI.WebControls.ImageButton' to type 'System.String'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.ImageButton' to type 'System.String'.
Source Error:
Line 176: Dim btn As IButtonControl = CType(uc.FindControl("ImageButton1"), IButtonControl)
Line 177: ContentPlaceHolder1.Controls.Add(uc)
Line 178: Me.form1.DefaultButton = btn
Line 179: uc.ID = "uc99"
Line 180: End Select

I don't have the time at the moment to figure out why it won't let you set the defaultbutton in codebehind, but I found that if you wrap the user control in a panel and set the panel's default button, it works...below is a simple uc I'm testing with:

Just a quick little trick I learned recently. Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:
(CODE)
I suppose it just offends my sense of decency to put inline VBScript on a…

Introduction
This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks.
Background
I had to provide a way for user…

This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…