473,662 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Server Controls Templates - best practices

I am not sure if web server control templates are the way to go or not, but
I would like to get some opinions on the best way to go about this.

I have a web page where administrators will specify which users have access
to various reports. The page will display the report name and a list of
users who currently have access. The administrator will be able to add or
delete from this list of users, then save the results to the database.
Basically, I want to be able to add or remove items to this list on the
client side, and have the server recognize the additions. I would also like
to avoid postbacks to the server when not absolutely necessary.

I know how to do this with classic asp, but I am developing in .net and want
to do this the best way so others will have no trouble managing the code.

Should I be using repeaters, datalists, datagrids, or a completely different
approach?

Any advice that can be provided would be a huge help.

i.e.

Report Name: Monthly Financial Statement

Users:

John Doe
Susan Parker
Tom Clancy

<add user> <remove user> <save changes>
Feb 8 '06 #1
3 1208
Alot of people get really anxious about doing postbacks to the server.
Unless you will have 1000+ people accessing this at the sametime, the
load on your server is negligable. I have had many apps that I had to
do multiple postbacks and I have never had a problem.

I would make it so, when you click the "add user" button, it sends the
reportID, userID to the server and execute an "AddUserToRepor t" method.

In other words, process each addition of a user to a report, right when
that one user is added. This is going to require less code on the
server side and less headache for you. If you do it the other way, you
will have to store a collection of values in the clients session, then
when they click "save changes" you'll have to iterate through the
collection and do multiple database calls anyways.

Just a suggestion, I always try to take the route that requires me to
code less, because thats less code to maintain later on, and easier to
read code.

my 2cents

Feb 8 '06 #2
Thanks.
This particular app will only have a handful of users, so the added network
traffic should be negligible.

What would you recomend using a control template, building the user list
with a loop, or some other method?

"DKode" <dk****@gmail.c om> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Alot of people get really anxious about doing postbacks to the server.
Unless you will have 1000+ people accessing this at the sametime, the
load on your server is negligable. I have had many apps that I had to
do multiple postbacks and I have never had a problem.

I would make it so, when you click the "add user" button, it sends the
reportID, userID to the server and execute an "AddUserToRepor t" method.

In other words, process each addition of a user to a report, right when
that one user is added. This is going to require less code on the
server side and less headache for you. If you do it the other way, you
will have to store a collection of values in the clients session, then
when they click "save changes" you'll have to iterate through the
collection and do multiple database calls anyways.

Just a suggestion, I always try to take the route that requires me to
code less, because thats less code to maintain later on, and easier to
read code.

my 2cents

Feb 8 '06 #3
if you are talking about what method to use to populate the usercontrol
with the list of users that have access to that report, I personally
would use a datagrid, query your database to get a dataset of the users
for that report, then bind the datatable to the datagrid. then perhaps
put in a checkbox column in the datagrid, checking off users that
already have access, then as someone clicks a checkbox to add a user to
the report, attach the checkbox event and add ur code to add the user
to the database in the event handler for the checkbox.

there is always lots of different ways of solving a problem, but at
first glance and from what you described, this is the method I would
take. You might have other requirements in there that i'm not aware of.

Feb 8 '06 #4

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

Similar topics

0
2221
by: asj | last post by:
luke: BORRRRRRRRING......the most interesting initiatives are happening on the client side - in small wireless devices such as cellphones and smartphones, where J2ME has become the de facto standard for application development. Article from Javaworld.com: "Java everywhere is for world domination" http://www.javaworld.com/javaworld/jw-08-2003/jw-0822-wireless.html? Some quotes:
136
9307
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
3
1426
by: Todd | last post by:
Hello, I'm looking for a book with in-depth coverage of developing server controls, particularly custom controls. Ideally, the book would have a good amount of how-to's and best practices, but also serve as a fairly complete reference. It doesn't need a whole lot in the way of introductory material as I already have most of the basics down. So I've narrowed my search down to 2 books: "Developing Microsoft ASP.NET Server Controls and...
3
1857
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that I am hoping someone can help clear up. 1. What is the difference between initializing a control in the constructor, vs the OnInit(), vs the CreateChildControls() methods? 2. The control that I created contains an Items collection attribute...
3
3973
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which step you're on. This all works fine, but I ran into some trouble when I started creating controls dynamically in my code-behind file. Each panel contains a table which is filled with various radio buttons, text fields and the such which are...
5
3584
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
3
1690
by: Jon Paal | last post by:
how do I load controls to the templates for the DataList control. <asp:datalist id="dl1" runat="server" > <ItemTemplate> " how to load control(s) here ????" </ItemTemplate> </asp:datalist>
3
1811
by: Mukesh | last post by:
Hi all As per my earlier conversation with Ciaran (thx for reply) I have installed the MS APplication block on the server , when i ran Build Enterprise Library file and Install Services from (batch files ) programme files menu it was asking for visual studio 2003 , I have only .net framework on the server how can i use the MS application block data access library on my server plz help... Mukesh Agarwal
4
1339
by: sean_mcad | last post by:
We are starting to standardize what we have been doing with our web applications and I have a “cost-benefit” question when it comes to some server controls. Main two examples is Plain text vs. <asp:label /and <divvs <asp:panelsfor current static information. In my view if we go ahead and make all things static into server controls anyway then we have the advantage of things like localization, skins and
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8344
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8764
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6186
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.