What is the difference between User Controls and Custom Controls?

User Controls are text files with the extension ’.ascx’ which enables you to make GUI re-usable controls. Its a text file, which contains a mixture of HTML and scripting. User Controls can be edited in an editor. On the other hand Custom Controls reside in compiled ( Dll ) assemblies. They are non-GUI but can emit HTML GUI at runtime. Example of Custom Controls would be the sever controls which come bundled with the .NET SDK like DataGrid, Repeater, DataList etc. Custom Controls are always compiled into Dll’s and hence require good programming knowledge. The purpose of Custom Controls is also to create re-usable units of code.

How to maintain Scroll Position in any Page Element

Check out Jim Ross’s article Maintain Scroll Position in any Page Element The article describes, when using a scrollable Datagrid–one inside an overflow-auto DIV control–how to maintain the user’s scroll position inside the DIV across postbacks. It does this using IE behaviors, HTC files.

How to create server controls at runtime

Here is an example of creating a HyperLink control in code. VB.NET Dim hpl As New HyperLink() hpl.Text=’Text’ hpl.NavigateUrl=’http://www.syncfusion.com’’ hpl.ID=’theID’ Page.Controls(1).Controls.Add(hpl) C# HyperLink hpl = new HyperLink(); hpl.Text=’Text’; hpl.NavigateUrl=’http://www.syncfusion.com’; hpl.ID=’theID’; Page.Controls[1].Controls.Add(hpl);

How to change the image button size during runtime

VB.NET Dim x As New Unit(’80px’) Dim y As New Unit(’20px’) Dim imagestate as string= ‘stand’ If imagestate = ‘stand’ then imagebutton1.height = x else imagebutton1.height = y end if C# Unit x = new Unit (’80px’); Unit y = new Unit(’20px’); string imagestate=’stand’; if( imagestate != ‘stand’) { ImageButton1.Height = x; } else { ImageButton1.Height = y; } For more details Setting Web Server Control Properties Programmatically