473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can i change Web.config property in Asp.net 2.0??

i work on asp.net 2.0 so i have to change property of web.config file on the
web page

i mean when i make a board i want to change PageSize in the web.config file.

so i use ConfigurationManage.AppSettings["PageSize"] when i getting property
value.

but i also want to set this property.

ConfigurationManager.AppSettings["PageSize"] = "10"; <==== it's not work
because it doesn't have setting property

<appSettings file="GlobalSettings.config">
<add key="PageSize" value="15" />
......
give me some help ..please...
Nov 19 '05 #1
1 1900
re:
but i also want to set this property.
You can't set AppSetting properties like that.
If what you're looking for is a way to modify web.config on the-fly, see :

http://msdn2.microsoft.com/en-us/lib...ettingssection

Remember, though, that if you do that your application will restart.
This is new in the .Net Framework 2.0.

See the complete system.configuration namespace at :

http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"somequestion" <so**********@gmail.com> wrote in message
news:OG**************@tk2msftngp13.phx.gbl...i work on asp.net 2.0 so i have to change property of web.config file on the web page

i mean when i make a board i want to change PageSize in the web.config file.

so i use ConfigurationManage.AppSettings["PageSize"] when i getting property value.

but i also want to set this property.

ConfigurationManager.AppSettings["PageSize"] = "10"; <==== it's not work because it
doesn't have setting property

<appSettings file="GlobalSettings.config">
<add key="PageSize" value="15" />
......
give me some help ..please...

Nov 19 '05 #2

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

Similar topics

1
by: José Joye | last post by:
Hello, I have an assembly that is used by a VB6 application. This application can be a normal exe or an ActiveX (called through CCW). My assembly needs to get extra info from a config file. In...
4
by: brent | last post by:
Currently our application is reading from the web.config, and retrieves a section, "softwareRequirements". Because the section will begin to grow dramatically, I'd like to place it in the SQL...
1
by: Iwan Petrow | last post by:
Hi, I have dynamic properties (for checkboxes Checked property which I use in Option dialog box) . After I change checkboxes check properties I use DOM to save the changed values in the config...
0
by: CSharpner | last post by:
How can I do the following?: Have a label on a form have its Text property bound to a setting from one of my DLL library's config files? I've followed these instructions to successfully get...
4
by: Dan | last post by:
H, i want to use for one specific application the default membership provider as defined by default in machine.config, except one element: i want to use requiresUniqueEmail="false" instead of...
5
by: Kevin S Gallagher | last post by:
I have been attempting to read a value from the starting executable while in a DLL. So far have tried the following were "Test" is a defined value in the EXE. What is returned is a blank/empty...
2
by: VB Programmer | last post by:
Using ASP.NET 2.0 Created DataSet1.xsd. It's using the Connection "ASPNETDBConnectionString (Web.config)". I want to use a different one, LocalSqlServer. How do I change it? I tried to...
2
by: steven | last post by:
hi as many web developers do, i sniff the URL of my app and toggle things like the db connection string, default email recipients, etc dynamically based on what i find (ie. dev.mysite.com,...
0
by: Smokey Grindel | last post by:
I have the file logger set up in my app.config using the default settings, but I want to change some properties on how it acts, how do I go about doing this? right now all I have is ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.