473,761 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best practice to save user and session preferences for a .NET application?

RS
Hi,
What's the best practice to save user preferences for a .NET
application . For example if the user does not want anymore to see
Tip-Of-The-Day (TOTD), the user can tick a checkbox on the window
showing the tip (TOTD). That tick will be recorded so that next time
the user logs in, the application will suppress the display of TOTD.
Now if I expand this simple example, say the user is so expert at what
he does with the application he can choose to hide all the "Warnings
Messages" and other FYI Messages etc... Also say the user would like to
have control over background colours, font size and type etc...

What is best practice to save all those preference?

Is it to capture them in a User-Profile object and persist that object
locally on the machine and then load it every time the user logs in so
its accessible through out the application?

How about if I want the profile to be saved remotely also, say I want
the user to have the same look and feel from any machine he choose to
access the application?
Thanks

Nov 21 '05 #1
6 1559
RS,

You ask a lot, and starts already given yourself an answer. However than
first another question if you are sure about it.
How about if I want the profile to be saved remotely also, say I want
the user to have the same look and feel from any machine he choose to
access the application?

How if one is an old portable 12" screen and one is a very advantage
computer with by instance an 21" screen.

Otherwise my answer is always the same in this kind of question.
machine settings is the registry
application settings a xml file, in my case just a dataset.

Cor
Nov 21 '05 #2
On Thu, 12 May 2005 15:20:36 +0200, "Cor Ligthert"
<no************ @planet.nl> wrote:
RS,

You ask a lot, and starts already given yourself an answer. However than
first another question if you are sure about it.
How about if I want the profile to be saved remotely also, say I want
the user to have the same look and feel from any machine he choose to
access the application?

How if one is an old portable 12" screen and one is a very advantage
computer with by instance an 21" screen.

Otherwise my answer is always the same in this kind of question.
machine settings is the registry
application settings a xml file, in my case just a dataset.

Cor

I would go along with the method you suggested, i.e create a user
options object and persist it to XML, either in a remote shared
location such as a database or shared folder, or a local directory.

However Cor makes a very valid point in that if options are instance
or display capability dependent, it makes sense to make the get method
intelligent enough so that its return is downgraded to the
capabilities of the machine in question.

Doug Taylor

Nov 21 '05 #3
RS
Thank you all...
We have a pretty much cosistent closed environment.
Please add to the topic and enrich it
Thank you
MSA

Nov 21 '05 #4
RS
Thank you all. As for the displays. WE have a closed environment where
each one has the same display size. If that is not an issue, So i
assume serilaizing into XML is the new way to go?

Nov 21 '05 #5
RS
Thank you all. As for the displays. WE have a closed environment where
each one has the same display size. If that is not an issue, So i
assume serilaizing into XML is the new way to go?

Nov 21 '05 #6
On 12 May 2005 10:08:04 -0700, "RS" <lo**********@g mail.com> wrote:
Thank you all...
We have a pretty much cosistent closed environment.
Please add to the topic and enrich it
Thank you
MSA


There isn't a right or wrong answer to this sort of question, it comes
down to what your in house development standards say, then your
analysis of the best approach for current situation and the project
throughout its intended life span.

Yes XML is the flavour at the moment and has many distinct advantages,
particularly used with .Net, but in ten years we may wonder why we
ever did it that way!

Doug Taylor
Nov 21 '05 #7

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

Similar topics

15
7663
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not there at all? Any feedback would be helpful. Thanks! -Josh
136
9444
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,...
41
3435
by: Mountain Bikn' Guy | last post by:
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.
11
2422
by: Tom | last post by:
I am planning on adding a Preferences form to my application and using the Property Grid to display the preferences to the user. What do you think would be the best way to save these preferences out to an XML file? Use the CAB (Configuration Application Block)? Save the preferences in a class object and serialize them out the the XML file? Write them out directly to the XML file? Other ways??? Just want to get some thoughts together......
5
2532
by: BK | last post by:
We've got a fairly large scale development process under way in .NET 2003. We are about a month away from go-live for phase 1, second phase is rather short and all work should be completed in the next 2 months. Looking back on problems encountered, we want to learn from this project. FWIW, we are nearly on time with the original time line (only off by about a month), and we actually added more functionality than the original specs...
6
1658
by: The Colonel | last post by:
In a .vb class function, can I assign user-specific information (e.g. First Name, Role, etc.) to local variables (as opposed to referring to the session variable multiple times)?
9
7301
by: david | last post by:
I have a class with some business-logic and with every roundtrip, I need an instance of this class, so I have to create it, every time again. That doesn't seem very efficient. I thought it would be 'better' to store an instance of this class in a session-variable, so it's available all the time and needs to be instanced only once. Is this, generally speaking, a good idea, storing objects in session-variables ? Do you guys ever use this...
7
3583
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id - FirstName - LastName - CompanyId (many-to-one )
3
4031
by: at_the_gonq | last post by:
Hello, I am hoping to get some guidance on the following scenerio: I have a password protected site where users have various permissions. Are sessions the best way of storing the user's id? And if so, on load of a page should I be hitting the database for their permissions (based on the session stored user id), or should everything I need be stored in session variables to save the trip to the database? I have also wondered about...
0
10136
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9925
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,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
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
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
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.