Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in my app.xaml i added these codes for making a login page
here the codes:
C#
public App()
        {
            this.Startup += this.Application_Startup;
            this.Exit += this.Application_Exit;
            this.UnhandledException += this.Application_UnhandledException;

            InitializeComponent();
            setAuthenticationContext();
        }
        private void setAuthenticationContext()
{
var webcontext = new WebContext
{
Authentication =

new FormsAuthentication()
};
this.ApplicationLifetimeObjects.Add(webcontext);
}

but i have a error on webcontext , plz help me to solve it
Posted
Updated 13-Feb-12 23:43pm
v2

As the documentation states[^], you have to put a reference to the System.Web assembly (on Visual Studio, menu item Project->Add reference...).
 
Share this answer
 
Add "()" at the line new WebContext
C#
var webcontext = new WebContext()
{
Authentication =

new FormsAuthentication()
};
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900