Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi guys..

 

Im not new to C# or code behind.. However im just starting on ASP.Net controls.

 

Coming from a OO Javascript background, and making user controls with it, Im actually wondering how to do this effectively in ASP.Net.

 

Having some discussion with a few people.. Im left with this picture.

 

1) Create elements in ASP.Net web form.

2) Create events in code behind

3) Have some clientside functionality in seperate .js file.

4) Include any CSS in .css files..

 

Surely this is wrong, I mean. I can dynamically create a webpage (on the fly) and make it dynamic (dhtml) all from javascript.. And the code is in 1 file.. not 4 places like the above.

 

Can someone please put me in the know, with developing complex objects for the clientside, i.e Tabs/Calendar/Scroll Pane, etc..

 

Also, please don't link to code project.. As their examples are a bit rubbish.. To be honest, looking here..:- http://www.coalesys.com/home/

 

Im sure all their .net components aren't split into different areas.. Im sure its all done properly in codebehind.. However how is it done?

 

Thanks for taking the time to answer my question :)

  • Moderators
Posted

I prefer to create a template class and have my pages inherit from it, the CSS is in a seperate file and the JS is created on the fly (mostly in the base class)

 

The same thing can be achieved with a user control for menus and such but I prefer to stick it into the base class as well.

Visit...Bassic Software
  • *Gurus*
Posted

Whether or not spreading your control over a few files is the right or wrong way of doing things from a consolidation standpoint, you're going to find out that your control is far less customizable and scalable if you place it into a sole assembly.

 

Regardless, things to look into if you plan on consolidating:

 

Page.RegisterClientScriptBlock()

WebControl.ApplyStyle()

WebControl.MergeStyle()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...