Building controls....sorta newbie!

  • Thread starter Thread starter Craig G
  • Start date Start date
C

Craig G

i posted this yesterday in the building controls messageboard but got no
reply so i thought id post it on here



Hi,

i have built myself a webusercontrol that contains a single datagrid

the datagrid is based upon a couple of template columns and having add,
edit, update, cancel, delete commands all available within the grid

i have setup up all the OnEditCommand, OnItemCommand HTML etc so that it
fires the corresponding events/methods in the code behind page

at the minute i just have stubbs for each event in the code behind page.

what i was wondering. how would i go about saving this grid as it is, so
that i could then use this as like a base control that i could drop into a
new user control? would i have to create the control on its own or what??

am i making sense?

Cheers,
Craig
 
Hi Craig,

If I understand you correctly, you built a UserControl, which is a templated
Control with a Template and CodeBehind. If you want to use Inheritance, your
best bet is to build a Server Control instead. A Server Control has no
template; it's all class code. WebControls and HtmlControls are Server
Controls. The Render() Mathod of a Server Control builds the HTML for it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
Cheers for that, ill probably be back in a bit with a few custom server
control q's!

Cheers,
Craig
 
Back
Top