473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Need All Your Views on using Web User Controls.

Hi,

I use a lot of web user controls for web development.

And I need all your views on this.

(1)Does the functionality(Logic part) of a web user control should be
included in the aspx page that uses the web user control using events.

If you are doing this way, you will be able to use the same user control
for different purposes(but you need to code in all the aspx pages that
uses the webuser control)

(2)Does the functionality(logic part) of a web user control should be
included in its code behind itself(.ascx.vb)

If you are doing this way, the way the user control works or behaves is
predefined and you can't change it for different aspx pages that uses
this user control(but no need to code in all the aspx pages that uses
this user control)

All of your views on this are welcome, I would like to know more about this.

Any help on this will be appreciated

Thanks
Kiran
Nov 19 '05 #1
2 1095
Kiran wrote:
Hi,

I use a lot of web user controls for web development.

And I need all your views on this.

(1)Does the functionality(Logic part) of a web user control should be
included in the aspx page that uses the web user control using events.

If you are doing this way, you will be able to use the same user
control for different purposes(but you need to code in all the aspx
pages that uses the webuser control)

(2)Does the functionality(logic part) of a web user control should be
included in its code behind itself(.ascx.vb)

If you are doing this way, the way the user control works or behaves
is predefined and you can't change it for different aspx pages that
uses this user control(but no need to code in all the aspx pages that uses
this user control)

All of your views on this are welcome, I would like to know more
about this.
Any help on this will be appreciated

Thanks
Kiran


I think the second way is the usual way: the ascx should be self-contained.
Note: you can add properties and events to your ascx, so you can influence
the behaviour a bit. If you need radical changes in behaviour, then you would
need separate ascx'es.
If you want just a placeholder where the main page can write output to,
use a PlaceHolder, not an ascx-without-code.

An example:
if you want your pages to consist of header, main and footer ascx'es, then
you could have just one header and one footer, but you will need several
"main" versions, depending on the functionality required.
Nov 19 '05 #2
Hans Kesting wrote:
Kiran wrote:
Hi,

I use a lot of web user controls for web development.

And I need all your views on this.

(1)Does the functionality(Logic part) of a web user control should be
included in the aspx page that uses the web user control using events.

If you are doing this way, you will be able to use the same user
control for different purposes(but you need to code in all the aspx
pages that uses the webuser control)

(2)Does the functionality(logic part) of a web user control should be
included in its code behind itself(.ascx.vb)

If you are doing this way, the way the user control works or behaves
is predefined and you can't change it for different aspx pages that
uses this user control(but no need to code in all the aspx pages that uses
this user control)

All of your views on this are welcome, I would like to know more
about this.
Any help on this will be appreciated

Thanks
Kiran

I think the second way is the usual way: the ascx should be self-contained.
Note: you can add properties and events to your ascx, so you can influence
the behaviour a bit. If you need radical changes in behaviour, then you would
need separate ascx'es.
If you want just a placeholder where the main page can write output to,
use a PlaceHolder, not an ascx-without-code.

An example:
if you want your pages to consist of header, main and footer ascx'es, then
you could have just one header and one footer, but you will need several
"main" versions, depending on the functionality required.

Thanks Hans, I get the idea.
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
0
by: Jesper DK | last post by:
Hi, I'm writing a windows explorer like application. The GUI is divided by a vertical splitter. To the left I have a tree control. To the right of the splitter I would like to display one of...
8
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta)...
6
by: Phillip N Rounds | last post by:
I have an application which is heavily graphics intensive, all the graphics being custom. Scattered throughout by app, I have MyView->OnDraw( this->GetDC() ); Apparently, each call to ...
9
by: Tony Johansson | last post by:
Hello! Some information to be able to have a change to answer the question. Assume I have a large system developed in MFC. In this system we have only C++ code so no other language exist. This...
2
by: Sky Sigal | last post by:
Hello: I'm currently messing around, and need as much feedback/help as I can get, trying to find the most economical/graceful way to build usercontrols that rely on styling to look any good... ...
7
by: nicholas | last post by:
Hello, Got a kind of e-commerce site. There are products with product options, such as color, size, etc All are defined a table: tbl_products: the table with the products. tbl_options: the...
0
by: cvijaykrishna | last post by:
i am having a web based application and i am having a problem with it pls check it Explanationi am sending a sample code plese see it in VS-2005 FOR BETTER UNFERSTANDING I have a main page...
4
by: DC | last post by:
Hi, the subject says it all. Since visible=false controls will still run though Page_Load, I was hoping that the MultiView would somehow manage to avoid a Page_Load of controls in its inactive...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.