Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing server controls

Status
Not open for further replies.

TheCivic

Programmer
Feb 7, 2006
34
GB
Hi all,

i think i have my head around server controls now, but just wondering if there are special methods that i should override in my server control? People are on about the Render Method and something about adding child controls? Should you put certain code within these methods? Anyone got any info, or something i can read on this?

Also, i have created my server control but i am trying to register a client script, but for some reason the following line errors.

Dim clientManager As ClientScriptManager = Page.ClientScript

ERROR MESSAGE : Object reference not set to an instance of an object

Anyone know why this is? Is it because it is within the server control, and maybe its not within a certain method??

Thanks in advance.
 
Got the error message to disappear, which is great, but the script still hasnt appeared within the source of my page? Any ideas?

The clientscriptManager code is in my load event, and the control is on my master page directly.

Anyone got any ideas on this?

Also, the events that appear within a server control, should i use a particular event to set all my controls and child control styles or does this not matter? Any details on how to improve the performance or other factors of server controls would be appreciated.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top