Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you use Settings.Settings file for ASP.Net sites also?

I have a code base that has been used as an ASP.Net web application. It's now branching out and being used as part of two WinForms applications.

The main difference is that the WinForms apps should store their settings "per user" and the web app only needs to store the settings at the "application" level. They are the same settings, but stored differently depending on type of application.

Clarification: The same code will be used as the foundation for a web site application as well as the code base for a desktop application. In the desktop application the settings should be stored in the appropriate user directory, but that's not workable when the same code is running the web app. Hence the dilemma. How to switch from a web.config-type situation for the web app to a user.config-type situation (stored in the proper directory) for the desktop app.

Does anyone know if the settings.settings file is workable for a web app?

Is there a better way to store the same settings in two different ways?

like image 578
Jared Avatar asked Jun 27 '09 03:06

Jared


1 Answers

Yes, you can use Settings.Settings files for web application projects. Set it up just like in your WinForms projects. With a web project, you are limited to Application scope though - you cannot create user-scoped settings.

like image 89
womp Avatar answered Oct 14 '22 12:10

womp