servercontrol

How do I convert an ASP.NET page using Ajax webmethods to an Ajax-enabled servercontrol?

In this tutorial I am reading, Dave Ward creates a page that shows the server date in a label without using the update panel. I am trying to learn how to create servercontrols that use ajax for partial postbacks where methods within the control are called from clientscript generated by the same control, and I think that learning how to...

Create server control like panel and linklabel using javascript.

I want to add panel control using javascript inside the TD element. Is it possible to create these control using Document.createElement and appendChild methods? I also want to show and hide this panel control onmouseover and onmouseout event. ...

ASP.NET server control: how to convert design-time string into object type (TypeConverter?)

So hopefully this is a silly question (that would make it easily answered). I'm trying to make a composite server control that encapsulates a TextBox, some validators and other stuff, depending on the type of field required. My control has a "DataType" value that lets me determine what to display. For example if DataType is "Date" I re...

Server control losing mousedown event handler on callback

I have a composite server control that contains a div to which I attach a right click event handler in the Render method (simplified for clarity): protected override void Render(HtmlTextWriter writer) { base.Render(writer); writer.write(@" <script type=""text/javascript""> document.getElementById(""myDiv"").onmousedown ...

Allowing any property/attribute on a server/usercontrol

I've noticed that on most, if not all, standard web controls in the System.Web.UI.WebControls namespace, you can add any properties you want to them without crashing the page. Take the asp:Button control for an example. This code is perfectly valid: <form runat="server"> <asp:Button runat="server" Text="Test button" crapAttribute=...