Web Forms :: Method For Specifying Application Wide Settings?

Apr 5, 2010

I want a separate config file (not app.config) that stores style for various controls in my web application. For example i want to specify the CSS file that modifies all instances of GridView in the website. what is best practice?

View 2 Replies


Similar Messages:

Web Forms :: Using Application Wide Master Pages?

Jan 12, 2011

i added this entry in my web.config file

pages
masterPageFile="~/default.master"

so that all my content pages (.aspx) in my application could use default.master as their master page,

i read we do this so that we don't have to mention the MasterPageFile="~/default.master" everytime in all the .aspx content pages, but , my query is whenever i add a new .aspx page in my website from VS 2010, it dosen't automatically add MasterPageFile="~/default.master" to the Page header, am i missing something.

View 2 Replies

Store / Access - Application Wide Variables Or Globals In Asp.net

Feb 8, 2010

What is the recommended or usual way an ASP.net web application(in C# language) can store/access values that are needed accross the various pages in a website. For example a basic company website might need the company's name and other related information available to multiple pages. Where do I declare these variables/values and how do I access them. Coming from c++ application programming I would usually store such data in a Singleton class object.

View 5 Replies

Access "Application" Object In MVC To Store Application Wide Variables?

Aug 7, 2010

How do I store a variable or object application wide in ASP.net MVC. In regular ASP, you had the Application object, and in ASP.net too apparently.

View 1 Replies

Web Forms :: Can't Read Application Settings From Global.asax In C# VS 2010 Web Project

Jul 22, 2010

I'm working on a new C# web application in Visual Studio 2010, and am having problems reading a value in Web.Debug.Config from the GLobal.asax.cs file.

In the Application_Start event I've got the following code:

Application.Add("AppID", ConfigurationManager.AppSettings.Get("AppID"));

I also tried:

Application.Add("AppID", ConfigurationManager.AppSettings["AppID"]);

And in the Web.Debug.Config file I have the following:

<applicationSettings>
<add key="AppID" value="123" />
</applicationSettings>

I also tried:

<appSettings>
<add key="AppID" value="123" />
</appSettings>

And I tried having it in a file path, like so:

<appSettings file="C:MyPathappSettings.config"/>

When running in debugger, I've got a break-point in the Application_Start event in Global.asax.cs. It hits the break point, but in all cases the value coming back from ConfigurationManager is coming back null. What am I doing wrong?

View 3 Replies

Web Forms :: Application Error Occurred On Server - Current Custom Settings

Nov 13, 2013

I recently bought domain and hosting from godaddy.com and uploaded my website files based on asp.net on server.

The problem is when i run Default.aspx file in visual studio it runs properly but same set set of files when ran after uploading on server gives error in web.config file.

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details:  To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
WindowsMicrosoft.NetFrameworkv2.xConfig
-->

[Code] ....

View 1 Replies

C# - Web Application Azure Settings?

Dec 6, 2010

We're currently refactoring our ASP.NET 4.0 Web Application to run on both plain old IIS and Azure. For the Settings (in the Properties namespace), I'd like to implement the State Pattern with an AzureSettingsState and a StandaloneSettingsState, which both provide settings getter methods.Now could anybody help me figuring out how ASP.NET deserializes the non-String values (e.g. TimeSpan or StringCollection), so that I can deserialize them on my own in the context class? All settings seem to be strings there.

public abstract class ConfigStateBase
{
public abstract string GetSettingValue(string setting);
}

View 1 Replies

Keep Loosing Application Settings?

Apr 15, 2010

I'm having a weird problem with one of my .net windows applications. I store a number of settings in the application settings (User Scope) but from time to time the settings just seem to dissapear when it's run on the server.

View 3 Replies

Use XML To Store Configuration Settings In C#.Net Application?

Mar 11, 2011

My question relates to the performance implications of reading application configuration data from an XML file.I am building an application that lists information from a database and needs to know how to display the lists, depending on the types of data returned.This is difficult to explain, but basically I would like to have an XML config file that lists the types and describes how to display them. This will allow me to change the display methods without re-compiling the application.

My question is really around performance. Given that my application will need to use this data many times during each page load...Should I be reading directly from the XML file and parse it each time I need it?
Or should I cache the XML object and parse it each time I need it?Or should I parse the XML once, generate some sort of object and cache that object?My guess is option 3, but I'm basically fishing for best practice around this.

View 1 Replies

C# - Migrating Web Application Settings As Configured Through IIS?

Jul 15, 2010

We have a few settings in our web application that can be user configured. As IIS exposes helpers for configuring "Connection Strings" and "Application Settings" we decided to take use this method of configuration.

Unfortunately this works by editing the Web.config file deployed in the web application. This means that a simple upgrade process of copying over the files from a newer web application release resets all configuration settings to the default.

Possible options:

When upgrading the webapp, backup the Web.config and restore it afterwards. This is not elegant and if the latest webapp defines new default-valued properties in the Web.config then this will break Write some admin-only configuration pages on the site and store the values in the DB. This puts the control back in our hands, but it will take work to write this and obviously has bootstrapping problems with connection strings.

View 1 Replies

How To Read A Settings Value From The Web.config File In Application

Aug 18, 2010

I'm trying to use the following command:

Dim xmlFilePath As String = _
System.Configuration.ConfigurationManager.AppSettings("XmlFilePath")

to retrieve the following setting:

<applicationSettings>
<MySolution.WebProject.My.MySettings>
<setting name="XmlFilePath" serializeAs="String">
<value>C:ASP.NETFolderMessageLog</value>
</setting>
</MySolution.WebProject.My.MySettings>
</applicationSettings>

However, xmlFilePath shows up as Nothing after that line of code is run. What's the correct code to get a setting out of the web.config file in an ASP.NET application?

NOTE: Although you can add keys individually to the <appsettings> tag, I'm trying to figure out how to use it with the "Settings" tab in the project's properties.

View 2 Replies

State Management :: App Settings In Application Cache?

Dec 12, 2010

Is it suitable to store some app settings in Application Cache? I mean settings that might need to be changed frequently...

View 1 Replies

C# - Add Items To Properties.Settings At Runtime In Application?

Mar 11, 2011

I want to add an item at runtime to my global settings on an ASP.Net web application. It seems that the Properties.Settings.Default.Properties object is read-only, or at least it's Attributes are so I was trying to write directly into the web.config file. This works correctly but the stuff I found was just dropping my info into the AppSettings section, when I need it to be in the ApplicationName.Properties.Settings so it is made available through the Default.Properties object.

The code I have basically goes like this:

Configuration config = WebConfigurationManager.OpenWebConfiguration("/");
config.AppSettings.Add(mySettingName, myValue);
config.Save();

Which is fine and dandy, except that - obviously enough - my setting turns up in the <appSettings> section of the file. Is there a way I can use the Configuration object to access the ApplicationSettings/ApplicationName.Properties.Settings part of the configuration file? If so how? If not is there another way to write values into my application settings from code?

View 1 Replies

MVC Application Level Soft Coded Settings?

Oct 7, 2010

I am working on a ASP.NET MVC 2.0 Multi-Presentation web application which would use a common codebase to support different websites. These websites would differ in following aspects:

Each website will have their own headers, footers, images, CSS etc (I guess website specific Master Pages)
Some of the UI elements could be different based on soft-coded settings at website level

What is the best approach to handle these requirements? Should I be storing these website level soft-coded settings in Database or multiple config files? I might have to provide a admin UI to manage these soft-coded settings. How do I access these settings in different layers (MVC, Services, Repositories etc) of my application?

View 1 Replies

C# - Where To Store The Global Settings To Allow The Application To Access Them Frequently

Mar 7, 2011

I have some global settings in my application that is going to be handled by the administrator and I store them in the database.

Settings like: board on/off, max items/page on different UserControls, language, hide/show modules.

What technique should I follow to read the values in the database and display the page or the application according to it .. Of course I could do it the easy way and fetch the required settings for each page in the Page_Load event handler but I think that will be a lot of database connection!

View 1 Replies

Visual Studio :: Settings To Check To See What Bogging Down My Application?

Mar 8, 2010

I just uninstalled VWD 2008 Express and installed VWD 2010 Express (all details below). I'm noticing VERY slow load times, on the order of a couple minutes to like 5-6 minutes to load a page. I really don't think this is working right. Is there some setting that I can check to see what is bogging down my app?

Microsoft Visual Studio 2010
Version 10.0.21006.1 B2Rel
Microsoft .NET Framework
Version 4.0.21006 B2Rel

View 3 Replies

C# - Output Javascript Selectively Depending On Application Settings?

Feb 24, 2010

I am developing a site which includes several different javascript files and libraries. For optimization purposes I have implemented YUI Compressor for .Net

This will minimize and combine my javascript files into one single file.

Now I have put this up in a MSBuild script that automatically does the compression and minimization and outputs it to a file of my choosing. However, I still wish to keep the original javascript files in my development environment. My question is simply:

Is there a good way to depending on the Debug setting for example choose which javascript to use? This to not have to change the MasterPage by hand each time I release the build.

Allow me to illustrate.

If I am running in Debug="true" I wish my MasterPage to include the following javascripts:

<script type="text/javascript" src="first.js"></script>
<script type="text/javascript" src="second.js"></script>
<script type="text/javascript" src="third.js"></script>
<script type="text/javascript" src="fourth.js"></script>

If I am running in Debug="false" I wish this to be outputted in the MasterPage:

<script type="text/javascript" src="compressedAndMinimized.js"></script>

View 2 Replies

State Management :: Cache Settings On Shared Application Pool?

Sep 17, 2010

I have several web applications on a server using the same application pool. The worker process usually takes a lot of ram but usually only from one application. I can successfully limit the cache usage by setting "PrivateBytesLimit" in web.config file when the application uses it own dedicated application pool.

Does anyone know how this setting will be applied when using shared application pool? Is it per application, per worker process or per application pool? Also if it is not per application which setting from which application will be applied?

View 1 Replies

Installation :: IIS Settings To Handle Multiple Users And Application Pool?

Jun 9, 2010

In our IIS (v 6.0) there is one classic ASP app deployed, which has around 35 concurrent users. Now, a new ASP.NET(3.5) app needs to be deployed on the same server which will have its own 50 concurrent users. In this scenario should we create a Application Pool for this new .net app? What are other recommendations for the IIS settings in future?

View 3 Replies

Web Forms :: Radiobutton Displaying Too Wide On Page?

Apr 11, 2010

I have a asp radiobutton on my page and when I display the page it appears that the border for he radiobutton is 50px and the text for the radiobutton is shoved down to the next line. I have the markup for the radiobutton below. When I use a standard HTML radiobutton it appears correctly on the page. See markup below:

[code]...

View 5 Replies

Visual Studio :: Group Profiles Settings - Users In The Group Update The Same Settings?

Jan 19, 2010

We have many different clients, and each client can have multiple user accounts.Right now, we have user settings set up on the ASP project, and a WinForms application can see these settings, depending on which user logs into the winforms application. They are specific to the user. I want to make them specific to the client, so users can be in "groups" by their client, and all users in the group would see/update the same settings.

View 1 Replies

Where To Store And Set User Site Wide Data In MVC

Feb 16, 2010

I have an application in which a user can choose from different (learning)groups. User has only access to registered groups. When the user enters the site, he can choose (in a dropdown) which group he wants to see, so the complete site filters content related to that group. So every controller needs to access this global "group" object.What is the best way to do this in ASP.NET MVC? I've thought about a BaseController or ActionFilters. Is there any other best practice?I've build a WebForms application and there I used a BasePage so that any other page has access to the group.

View 2 Replies

C# - How To Create A Variable With Project-wide Scope

Feb 28, 2011

I want to declare a variable in such a way that I can access that particular variable and its value in all the asp pages in the project. Can anyone tell me how to declare a variable in C# such that it has project-wide scope?

View 8 Replies

What Folder To Put Site-wide Functions/classes In .NET MVC

Mar 22, 2010

I'm new to ASP.NET MVC and i want to create a class to contain site wide functions for my application.what is the best practice to do this?
where should i create the class ? in what folder?should i create a new folder?

edited:I need a function that return base uri, and it have be available to call from any controller.A date formatting function, or any other simple logic , but is going to be used repetitively

View 2 Replies

ReportViewer Control Rendering Too Wide On WebForm?

Feb 8, 2011

I have a ReportViewer (ver 10) that is rendering far wider than the box it's meant to display in. The problem is that the Parameters area is appearing much wider than the actual report area. If I put an "overflow: auto" in the div that contains the ReportViewer control, then I get a horizontal scrollbar at the bottom, but then in order to click the "View Report" button I have to scroll way over, thus moving the entire report.

Ideally I would like the Parameters area to stay stationary, but a horizontal scrollbar to appear on the report area so that it can be scrolled if necessary. What is the best way to go about doing this?

Here's what my control setup looks like now:

<div class="reportingFrame" style="text-align: center; width: 100%; overflow: auto">
<sam:ReportViewer ID="UiReportViewer" runat="server"
AsyncRendering="False"
ProcessingMode="Remote"
ShowExportControls="False"
ShowPrintButton="False"
ShowPromptAreaButton="False"
ShowRefreshButton="False"
SizeToReportContent="True"
Width="100%" />
</div>

Currently I'm looking at some jQuery tricks to reformat the output from the ReportViewer control into a better system

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved