Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: How to read Forms LoginURL?

Reply
Thread Tools

Re: How to read Forms LoginURL?

 
 
Daniel Fisher\(lennybacon\)
Guest
Posts: n/a
 
      11-30-2005
string _loginUrl = "/login.aspx";


System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(HttpContext.Current.Request.PhysicalAppli cationPath +
"web.config");

System.Xml.XmlNode node =
doc.SelectSingleNode("/configuration/system.web/authentication/forms");
if(node!=null)
{
if(node.Attributes["loginUrl"]!=null)
{
_loginUrl = node.Attributes["loginUrl"].Value;
}
}

--
Daniel Fisher(lennybacon)
http://www.lennybacon.com


"gabe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Is there a way to read the loginURL attribute of the forms element in
> the web.config file?
>
> We have a standard Login.aspx page we use for custom authentication.
> When the site is down for maintenance, we'd like to just change this
> parameter to "maintance.aspx". In our base page class we'd like to read
> from the cache based on the value that is set in the web.config. If the
> user is logged in and the loginURL is Maintenance.aspx, we'd like to
> SignOut and existing users and tranfer them to the maintenance page.
>
> Has anyone dealt with this before? Thanks for your help.
>
> Gabe
>



 
Reply With Quote
 
 
 
 
gabe
Guest
Posts: n/a
 
      11-30-2005
Thank you! That's exactly what I was looking for.



Daniel Fisher(lennybacon) wrote:
> string _loginUrl = "/login.aspx";
>
>
> System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
> doc.Load(HttpContext.Current.Request.PhysicalAppli cationPath +
> "web.config");
>
> System.Xml.XmlNode node =
> doc.SelectSingleNode("/configuration/system.web/authentication/forms");
> if(node!=null)
> {
> if(node.Attributes["loginUrl"]!=null)
> {
> _loginUrl = node.Attributes["loginUrl"].Value;
> }
> }
>
> --
> Daniel Fisher(lennybacon)
> http://www.lennybacon.com
>
>
> "gabe" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> > Is there a way to read the loginURL attribute of the forms element in
> > the web.config file?
> >
> > We have a standard Login.aspx page we use for custom authentication.
> > When the site is down for maintenance, we'd like to just change this
> > parameter to "maintance.aspx". In our base page class we'd like to read
> > from the cache based on the value that is set in the web.config. If the
> > user is logged in and the loginURL is Maintenance.aspx, we'd like to
> > SignOut and existing users and tranfer them to the maintenance page.
> >
> > Has anyone dealt with this before? Thanks for your help.
> >
> > Gabe
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
embedded windows forms into web forms for control =?Utf-8?B?ZGF2aWQ=?= ASP .Net 2 04-10-2005 01:07 PM
Creating ASP.NET forms, that act like HTML forms jlopes151 ASP .Net 2 03-14-2005 01:01 AM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM
Web Forms VS Windows Forms Brendan Miller ASP .Net 2 08-11-2003 09:05 PM



Advertisments