473,405 Members | 2,444 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,405 software developers and data experts.

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 FormsAuthentication via the
"FormsCookieName" and "FormsCookiePath" 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
programmatically 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 5247
FormsAuthentication.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 FormsAuthentication via the "FormsCookieName" and
"FormsCookiePath" 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
programmatically 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 FormsAuthentication.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:
FormsAuthentication.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 FormsAuthentication via the "FormsCookieName" and
"FormsCookiePath" 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
programmatically 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 FormsAuthentication.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:
FormsAuthentication.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 FormsAuthentication via the "FormsCookieName" and
"FormsCookiePath" 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
programmatically 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
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: ...
3
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...
2
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:...
5
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"...
4
by: Baby Lion | last post by:
it just makes me feel confusing ... what does ^ mean , and how to use it . thanks,
1
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
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...
4
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,...
5
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.