Showing posts with label practices. Show all posts
Showing posts with label practices. Show all posts

Saturday, March 31, 2012

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 changesAlot 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 "AddUserToReport" 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
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" <dkode8@.gmail.com> wrote in message
news:1139417436.694587.173730@.g47g2000cwa.googlegr oups.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 "AddUserToReport" 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
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.

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>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 "AddUserToReport" 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
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" <dkode8@.gmail.com> wrote in message
news:1139417436.694587.173730@.g47g2000cwa.googlegroups.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 "AddUserToReport" 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
>
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.

Monday, March 12, 2012

Web Services Encryption

I am becoming familiar with the standards and practices of secure Web
Services, particularly encrypting the messages with Tokens. What I don't
understand, and I can't find in documentation, is what type of encryption is
used with the tokens, and how the key(s) are passed from the client to the
service to decrypt the message. I need to know this so I can be assured
that an intercepted message cannot be decrypted just by using the
information in the message itself.I think for the tokens it leverages the same methods as XML
Encryption. Therefore, AES 128/192/256 and triple DES...
Check out:
Algorithms:
http://www.w3.org/TR/xmlenc-core/#sec-Algorithms
Spec:
http://www-106.ibm.com/developerwor...rary/ws-secure/
On Wed, 8 Sep 2004 13:30:36 -0700, "Random" <cipherlad@.hotmail.com>
wrote:

>I am becoming familiar with the standards and practices of secure Web
>Services, particularly encrypting the messages with Tokens. What I don't
>understand, and I can't find in documentation, is what type of encryption i
s
>used with the tokens, and how the key(s) are passed from the client to the
>service to decrypt the message. I need to know this so I can be assured
>that an intercepted message cannot be decrypted just by using the
>information in the message itself.
>
Alex Leblanc
Xceed Software Inc.
http://www.xceedsoft.com
Check out our advanced .NET zip file and compression library
Email: xLeblancA@.xceedsoft.com (remove the first 'x')

Web Services Encryption

I am becoming familiar with the standards and practices of secure Web
Services, particularly encrypting the messages with Tokens. What I don't
understand, and I can't find in documentation, is what type of encryption is
used with the tokens, and how the key(s) are passed from the client to the
service to decrypt the message. I need to know this so I can be assured
that an intercepted message cannot be decrypted just by using the
information in the message itself.I think for the tokens it leverages the same methods as XML
Encryption. Therefore, AES 128/192/256 and triple DES...

Check out:

Algorithms:
http://www.w3.org/TR/xmlenc-core/#sec-Algorithms
Spec:
http://www-106.ibm.com/developerwor...rary/ws-secure/

On Wed, 8 Sep 2004 13:30:36 -0700, "Random" <cipherlad@.hotmail.com>
wrote:

>I am becoming familiar with the standards and practices of secure Web
>Services, particularly encrypting the messages with Tokens. What I don't
>understand, and I can't find in documentation, is what type of encryption is
>used with the tokens, and how the key(s) are passed from the client to the
>service to decrypt the message. I need to know this so I can be assured
>that an intercepted message cannot be decrypted just by using the
>information in the message itself.

--
Alex Leblanc
Xceed Software Inc.
http://www.xceedsoft.com

Check out our advanced .NET zip file and compression library

Email: xLeblancA@.xceedsoft.com (remove the first 'x')