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

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top