Configuration :: Change Values In Web.config?
Mar 22, 2011
I have a website that has 2 databases and 2 folders , what I need to do is to create a combo box and if the user select " project1" I should see the tree that populates its data from the first database if user selects "project2" I sshould see the tree that populates its data from the second database , both the 2 trees will be populated in the same page following below is the part of the connection string and folder values for 1 selection but how can i add another one and change it on the fly from the combo box selection
<add key="FolderName" value="test" />
<add key="EnglishFolderName" value="demo1" />
<add key="Virtual path" value="/" />
</appSettings>
<connectionStrings>
<!--<add name="MyConnectionString" connectionString="Data Source=SADERSQLEXPRESS;Initial Catalog=LawsTest;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>-->
<add connectionString="Data Source=.;Integrated Security=True;MultipleActiveResultSets=True;Initial Catalog=TarbooshLaw" name="MyConnectionString(Arabic)" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
View 5 Replies
Similar Messages:
Nov 2, 2010
I've a windows service that will be calling an exe file (created from a console application). In this console application, I would take some values (especially connectionstring values) from the App.Config file of the console application.
But when this application is called from the windows service, it doesn't take the values from that app.config file. So, I added the same values in the app.config file of the windows service too..... But even here it doesn't take the values.
View 3 Replies
Jan 31, 2011
Is it possible to change web.config file at run time...
(here i want to change database connection details at run time)
View 1 Replies
Apr 22, 2010
I'm developping an ASP.NET web applition which will be running on a intranet server. The web application will read and write data from / to an access mdb.
The link to this mdb is specified under the web.config file. However, in this web.config, the connection string points to a absolute path (for ex. c:information.mdb).
Is it possble to change this path after the web application is installed on the server (without having it to open in visual studio)? This is needed, because the application will be installed at other locations too, all pointing towards their own server and mdb (and this mdb file won't be always be on the c: drive).
I tried opening the web.config file with notepad, and changing it. Everything seems to work, but I'm not sure this method is good. Since I assumed you have to rebuild the application if you change somthing in the code...
View 2 Replies
May 20, 2010
how can I access the following settings in the web.config through code? Cheers
<compilation debug="true">
<authorization>
<allow roles="MyGroups" />
<deny users="*" />
</authorization>
View 2 Replies
Mar 24, 2011
[Code]....
How to change ApplicationName in C# or gobal.asax, or web2.config
View 1 Replies
Sep 2, 2010
I have added the below tag in my web.config file;
<RewriterConfig configSource="configuration
ewriter.config"/>
It gets the rewrite vlues from another config file. I need to update this rewriter.config file dynamically.
I need to gets values inside it from sql databse. here is the look of the file
<?xml version="1.0"?>
View 3 Replies
Sep 14, 2010
I am having an issue where if I change my url to .asp from .aspx i get a 404 error but it is not handled by my custom errors. If I change the url to def23947823h.aspx it is caught and redirects to correct page.
[Code]....
View 8 Replies
May 3, 2010
I have deploy my web site, it contains a project!
in MyWeb there are all the aspx page and some entites datamodel, in MyApp there are the class with function like "getter data from DB" and there is a entity data model.
afeter the deploy, I have only the web.config and the connection string for the entity datamodel....itīs run ok, read/write the data on the DB.
The problem is with MyApp.....after the deploy it is a dll file and I donīt have the app.config and the entity inside it donīt run, not read/write nothing on the DB.
There arenīt error or messager but not read/write the data in the MyApp project.
all run on the iis 7
now...the question is:
I lose the connection string (in app.config) after the deploy?
Can I put a entity in the MyWeb and read it in another project (myApp)?
ps: for connect to DB I use not the c# code:
var db=from x in AccessDB.Example select x;
View 1 Replies
Jan 5, 2011
I am developing web applicaiton. I want to read web.config in App.config file. I have appSettings and connectionStrings in web.config. How to read that?
View 10 Replies
Jan 15, 2010
While using a third party dll I was getting the following exception - "exePath must be specified when not running inside a stand alone exe" with following trace
System.Configuration.ConfigurationManager.OpenExeConfigurationImpl(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath).
The reason I found was that it was looking for app.config and I had provided the details in web.config. My question is why does the system.configuration differentiate between web.config and app.config.
View 2 Replies
Aug 10, 2010
I upgrade my application from .NET 2.0 to .NET 4.0. Everything went smooth, with very few errors. Now the code is compiling fine, but run time environment is loading the configuration parameters from app.config instead of web.config;Here is my setup:Objects project: has app.configUI project: has web.config, When I run this site, it is fetching the configuration parameters from app.config. Any idea if I need to make any changes to read it from web.config instead of app.config? It used to work fine in my previous environment.
View 8 Replies
Jun 4, 2010
I built my ASP.NET website using vs2008 professional.
Now I have purchased vs2010 professional edition.
I do format my computer and then installed vs2010.
Now I want to deploy my website in vs2010, but it is giving configuration error in <add assemblies...
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
View 2 Replies
Apr 30, 2010
Web.config is the main settings and configuration file for an ASP.NET web application. The file is an XML document that defines configuration information regarding the web application. The web.config file contains information that control module loading, security configuration, session state configuration, and application language and compilation settings. Web.config files can also contain application specific items such as database connection strings
Example 1:
<!-- This is an example Web.config file -->
[Code]....
In this article, we will see how to read the configuration settings in the web.config using 'JavaScript'.
Step 1: Create a new ASP.NET website. Add a button control to the Default.aspx.
Step 2: Right click the project > Add New Item > Web Configuration File
Add the following sample entry to the appSettings section in the web.config between the <configuration> tag as shown in the example 1:
<add key="var1" value="SomeValue"/>
Step 3: To read these entries using JavaScript, add the following script in the <head> tag of your Default.aspx page as shown below:
<head runat="server">
<title></title>
<script type="text/javascript">
function ReadConfigSettings()
{
var v1 = '<%=ConfigurationManager.AppSettings["var1"].ToString() %>'
alert(v1);
}
</script>
</head>
Step 4: Call this function on a button click and display the values of the configuration settings
<input type="button" value="Get" onclick="ReadConfigSettings();" />
That's it. Run the application and click the button. The value of the key in the appSettings will be displayed in the alert window. I hope you liked this short article.
View 7 Replies
Jan 26, 2011
I keep getting the all-too-familiar Report Viewer Configuration error, even after double-checking changes in web.config.It worked fine yesterday morning. Then by late afternoon, after I uploaded some site changes, it reverted to throwing the error.Report Viewer Configuration Error
The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0
View 1 Replies
Nov 2, 2010
when developing in my pc , all is fine , but when upload to hosting , it show error ~
[img]http://image.love9cube.net/images/sadsadcgc.jpg[/img]
View 2 Replies
Mar 25, 2010
aspnet_regiis.exe -pdf "connectionStrings" c:web.config And this is the error I got. Error - "The configuration for physical path 'C:Web.Config' cannot be opened. And the permissions of that file is not read only.
View 2 Replies
Apr 20, 2010
How to change the values in gridview on text change of templated control without databind again?the value of templated text boxes should change If i change the value of one of the templated textbox then accordingly(By mathematical calculations) the vlaues of all tempated textboxes should also change.
View 7 Replies
Mar 30, 2010
I'm preparing to deploy a ASP.NET web application. The target server has already a previous version of my web application with parameters specified on the web.config file.
In the new version of this web application, the web.config file contains new sections I would like they appear into the target web.config file on the server.
However I can't find the way to merge the new web.config sections into the existing web.config file ?
Does I have to do it programmatically, or is there a tool to merge the both files during installation ? (I'm using Web Setup Project).
View 2 Replies
Mar 8, 2010
I would like to have a different connection string when I deploy the web application, without manage my web.config anytime.How can I do that?
View 2 Replies
May 6, 2010
I have a custom section on my Web.config as follows:
[Code]....
How can I redefine this section on Web.Release.config?I need to change all values.
View 3 Replies
Sep 29, 2010
I have a web-application with more than 5 themes. Each themes covers a completely different style for different customers. whenever we publish a new version of our application we send it for all of customers.
We specify theme in web.config file in <Page> tag. like
<page theme="Theme1" /> // or Theme2 for second customer.
with this approach we easily change the style of application from each other without writing codes which needs a new publish for each one.
With changing the theme="Theme1". nothing change and we didn't write a code in application , so why changing theme don't change the theme and we need a new publish?
we want to change it in web.config or somewhere else and with changing it the theme change without needing a new publish for each one.
Update :
I Publish Once and then copy the published version for each customer (5 times) then in each web.config file I change the theme="CustomerTheme". but only the theme which was active in publish process is usable in all of 5 versions and other 4 themes are un-usable Actually the main question is that why changes in Web.Config need a different publish while it is XML and do not need a complie. I should Add this note that, App_Theme include all of 5 themes so that all of them Compiles and are ready to use
This is the way I publish the application
Photo Link
Update 2
here IFound the exact problem reported by someone else. he resolve the problem but I can't underestand how he resolved this Issue.
View 2 Replies
Feb 21, 2010
I need to store an escaped html string in a key in web.config using the KeyValueConfigurationElement.Save method built into framework 3.5. But when I try to do so,it keeps escaping my ampersands.
Code looks like this:
strHTML = DecodeFTBInput(FTB1.Text)
FTB1.Text is a string of HTML, like this: <b><font color="#000000">Testing</font></b>
DecodeFTPInput uses the String.Replace() method to change < and > to < and >, and " to ".
Given the above string and function, let's say strHTML now contains the following:
<b><font color="#000000">Testing</font></b>
Of course I can manually edit web.config to store the correct value, but I need the authenticated admin user to be able to change the html themselves.
The problem is that when I try to save this string into its key in web.config, it escapes all ampersands
as & which ruins the string.
How can I get around this?
View 1 Replies
Oct 7, 2010
can i change the culture info from a linkbuttothe problem is like this : on the site i use 2 languages, english and romanian. in web.config the default culture="ro", and i was wondering if on clicking the link button, to change to english version, i can somehow change the culture info to culture="en-us".
View 1 Replies
Aug 9, 2010
I have the following in my web.config
<connectionStrings>
<add name="ActiveDirectoryConnection" connectionString="LDAP://ActiveDirectoryDomain1.com" providerName="System.Web.Security.ActiveDirectoryMembershipProvider"/>
</connectionStrings>
I need to add a dropdown box to my login page that allows the user to change the connectionString to a different string, e.g. "LDAP://ActiveDirectoryDomain2.com"
In C# code behind how do change the connectionString value?
More info:
The problem I am having is that there are 4 other web.config settings call that one connectionString. For example:
<activeDirectorySecurityContextSettings connectionStringName="ActiveDirectoryConnection" defaultADUserName="ReportUser" defaultADPassword="password"/>
View 3 Replies