473,569 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmatic access to web.config's <system.web> elements??

I've been trying to locate some property or method that will allow
programmatic access to the "loginUrl" attribute in the web.config file in the
<system.web> -> <authentication > element when the config file is set up for
Forms Authentication. I know certain system.web settings get mapped to
various properties/methods during runtime (e.g. <sessionState>' s timeout
attribute maps to the Session.Timeout property at runtime). You can easily
access the "name" and "path" attributes for FormsAuthentica tion via the
"FormsCookieNam e" and "FormsCookiePat h" properties, but there is no
"LoginUrl" property. I've looked in several other places, but I can't find
anything that gives me access to that. The only way I've been able to
programmaticall y access that is to load the entire web.config file into an
XmlDocument and then use XPath to access that element/attribute. That
doesn't seem like a "clean" way to go about this and since so many other
web.config properties are available at runtime, I don't see why loginUrl
should not also be easily available. Any ideas?

Thanks!

-Mike
Nov 19 '05 #1
3 5256
FormsAuthentica tion.LoginUrl

-Brock
DevelopMentor
http://staff.develop.com/ballen
I've been trying to locate some property or method that will allow
programmatic access to the "loginUrl" attribute in the web.config file
in the <system.web> -> <authentication > element when the config file
is set up for Forms Authentication. I know certain system.web
settings get mapped to various properties/methods during runtime (e.g.
<sessionState>' s timeout attribute maps to the Session.Timeout
property at runtime). You can easily access the "name" and "path"
attributes for FormsAuthentica tion via the "FormsCookieNam e" and
"FormsCookiePat h" properties, but there is no "LoginUrl" property.
I've looked in several other places, but I can't find anything that
gives me access to that. The only way I've been able to
programmaticall y access that is to load the entire web.config file
into an XmlDocument and then use XPath to access that
element/attribute. That doesn't seem like a "clean" way to go about
this and since so many other web.config properties are available at
runtime, I don't see why loginUrl should not also be easily available.
Any ideas?

Thanks!

-Mike


Nov 19 '05 #2
Brock,

Thanks for the response. Is FormsAuthentica tion.LoginUrl an ASP.NET 2.0
feature? I see no mention of it in 1.0 or 1.1. I can't access that at all.

-Mike

"Brock Allen" wrote:
FormsAuthentica tion.LoginUrl

-Brock
DevelopMentor
http://staff.develop.com/ballen
I've been trying to locate some property or method that will allow
programmatic access to the "loginUrl" attribute in the web.config file
in the <system.web> -> <authentication > element when the config file
is set up for Forms Authentication. I know certain system.web
settings get mapped to various properties/methods during runtime (e.g.
<sessionState>' s timeout attribute maps to the Session.Timeout
property at runtime). You can easily access the "name" and "path"
attributes for FormsAuthentica tion via the "FormsCookieNam e" and
"FormsCookiePat h" properties, but there is no "LoginUrl" property.
I've looked in several other places, but I can't find anything that
gives me access to that. The only way I've been able to
programmaticall y access that is to load the entire web.config file
into an XmlDocument and then use XPath to access that
element/attribute. That doesn't seem like a "clean" way to go about
this and since so many other web.config properties are available at
runtime, I don't see why loginUrl should not also be easily available.
Any ideas?

Thanks!

-Mike


Nov 19 '05 #3
Oops, you're absolutely right... it is.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Brock,

Thanks for the response. Is FormsAuthentica tion.LoginUrl an ASP.NET
2.0 feature? I see no mention of it in 1.0 or 1.1. I can't access
that at all.

-Mike

"Brock Allen" wrote:
FormsAuthentica tion.LoginUrl

-Brock
DevelopMentor
http://staff.develop.com/ballen
I've been trying to locate some property or method that will allow
programmatic access to the "loginUrl" attribute in the web.config
file in the <system.web> -> <authentication > element when the config
file is set up for Forms Authentication. I know certain system.web
settings get mapped to various properties/methods during runtime
(e.g. <sessionState>' s timeout attribute maps to the Session.Timeout
property at runtime). You can easily access the "name" and "path"
attributes for FormsAuthentica tion via the "FormsCookieNam e" and
"FormsCookiePat h" properties, but there is no "LoginUrl" property.
I've looked in several other places, but I can't find anything that
gives me access to that. The only way I've been able to
programmaticall y access that is to load the entire web.config file
into an XmlDocument and then use XPath to access that
element/attribute. That doesn't seem like a "clean" way to go about
this and since so many other web.config properties are available at
runtime, I don't see why loginUrl should not also be easily
available. Any ideas?

Thanks!

-Mike


Nov 19 '05 #4

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

Similar topics

0
347
by: I am Sam | last post by:
I don't know what is wrong with my web.config file. I can access web pages outside the "Administration" folder but when I try to access files inside that folder I get the following error: Parser Error Message: Unrecognized configuration section system.web. I don't know what the problem is. Everything in the web.config file looks fine....
3
2076
by: Varangian | last post by:
Hello, there I have a problem with regards to System.Collections.Generic.List<T> I need to pass a class with implements an interface - TestClass : IPerson I put this class in a List<TestClass> = new List<TestClass>(); then I pass this List<TestClass> to a function which takes an argument List<IPerson> person
2
4304
by: Bern McCarty | last post by:
In the old MEC++ syntax I can do this: // compile in VS 2005 shell with cl -clr:oldsyntax -LD ArrayCopyOldSyntax.cpp #using <mscorlib.dll> public __gc class CopyTest { private: System::UInt32 m_indeces __gc; public: CopyTest(unsigned int indeces __nogc, unsigned int arrayLength)
5
1911
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE" tagName="Navigation" src="~/Navigation.ascx"/> </controls> </pages>
4
8606
by: Baby Lion | last post by:
it just makes me feel confusing ... what does ^ mean , and how to use it . thanks,
1
1818
by: RSecor | last post by:
# sysctl -a | grep somaxconn kern.ipc.somaxconn: 1024 # perl -MSocket -e'print SOMAXCONN; print "\n";' 128 Anyone have any ideas why one would be 1024 and the other only 128?
0
844
by: enggwaqas | last post by:
I am exposing my Biztalk orchestration as a web service and want to consume this web service asyncly, but when i added web reference in my visual studio project it isn't displying Begin<Web Method Name> and End<Web Method Name> function?
4
2686
balabaster
by: balabaster | last post by:
Okay, I decided that I needed to understand the whole custom configuration file bits and so I've spent some time playing around with it. It seems (in the most) relatively straight forward. However, I've come unstuck with one scenario that I'm trying to figure out the code for: Consider the following configuration: <?xml version="1.0"...
5
1660
by: Steven | last post by:
I have the following in my web.config: <system.web> <profile defaultProvider="MyASPSqlProfileProvider" enabled="true" > <properties> <add name="FirstName" defaultValue="" type="string"/> <add name="MiddleInitial" defaultValue="" type="string" /> <add name="LastName" defaultValue="" type="string"/> <add name="Address1" defaultValue=""...
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7672
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...
0
7968
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...
0
6283
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...
0
5219
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...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
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
0
937
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...

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.