Click here to Skip to main content
15,921,279 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Want IE6 and IE7 in single OS? Pin
Michael Sync20-Aug-07 6:55
Michael Sync20-Aug-07 6:55 
QuestionFind ISP Address using Asp.net Pin
pjpspeed19-Aug-07 20:23
pjpspeed19-Aug-07 20:23 
QuestionCrystal Reports deployment in remote server asp.net 2005 Pin
Jay_se19-Aug-07 20:14
Jay_se19-Aug-07 20:14 
QuestionWhere do I get an ASP.NET PropertyGrid control? Pin
shubhabratam19-Aug-07 20:12
shubhabratam19-Aug-07 20:12 
AnswerRe: Where do I get an ASP.NET PropertyGrid control? Pin
Imran Khan Pathan19-Aug-07 21:20
Imran Khan Pathan19-Aug-07 21:20 
Questionedit ,cancel,delete datagrid Pin
saravanan0519-Aug-07 20:11
saravanan0519-Aug-07 20:11 
AnswerRe: edit ,cancel,delete datagrid Pin
Imran Khan Pathan19-Aug-07 20:30
Imran Khan Pathan19-Aug-07 20:30 
QuestionUsing namespaces in global.asax Pin
kbalias19-Aug-07 20:03
kbalias19-Aug-07 20:03 
Hi
I am using C# and ASP.Net for a web application. I have the following in the global.asax file:

<%@ Application Language="C#" %><br />
<br />
<br />
<script runat="server"><br />
    //using System.Security.Principal;<br />
    <br />
<br />
    void Application_Start(object sender, EventArgs e) <br />
    {<br />
        // Code that runs on application startup<br />
    }<br />
    <br />
    void Application_End(object sender, EventArgs e) <br />
    {<br />
        //  Code that runs on application shutdown<br />
    }<br />
        <br />
    void Application_Error(object sender, EventArgs e) <br />
    { <br />
        // Code that runs when an unhandled error occurs<br />
<br />
    }<br />
<br />
    void Session_Start(object sender, EventArgs e) <br />
    {<br />
        // Code that runs when a new session is started<br />
<br />
    }<br />
<br />
    void Session_End(object sender, EventArgs e) <br />
    {<br />
        // Code that runs when a session ends. <br />
        // Note: The Session_End event is raised only when the sessionstate mode<br />
        // is set to InProc in the Web.config file. If session mode is set to StateServer <br />
        // or SQLServer, the event is not raised.<br />
<br />
    }<br />
<br />
<br />
    protected void Application_AuthenticateRequest(Object sender, EventArgs e)<br />
    {<br />
        if (HttpContext.Current.User != null)<br />
        {<br />
            if (HttpContext.Current.User.Identity.IsAuthenticated)<br />
            {<br />
                if (HttpContext.Current.User.Identity is FormsIdentity)<br />
                {<br />
                    FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;<br />
                    FormsAuthenticationTicket ticket = id.Ticket;<br />
<br />
                    // Get the stored user-data, in this case, our roles<br />
                    string userData = ticket.UserData;<br />
                    string[] roles = userData.Split(',');<br />
                    HttpContext.Current.User = new GenericPrincipal(id, roles);<br />
                }<br />
            }<br />
        }<br />
    }<br />
<br />
       <br />
</script><br />

It gives the following message when I compile it:
The type or namespace name 'GenericPrincipal' could not be found (are you missing a using directive or an assembly reference?)

How do use namespaces in the global.asax file? When I add
using System.Security.Principal;
it gives the following error: Invalid token 'using' in class, struct, or interface member declaration.

Any advise will be appreciated.

Thanks.

Kobus
QuestionPublishing my web site Pin
samerh19-Aug-07 19:30
samerh19-Aug-07 19:30 
AnswerRe: Publishing my web site Pin
Eduard Keilholz19-Aug-07 19:47
Eduard Keilholz19-Aug-07 19:47 
QuestionProblem with Global asax file [modified] Pin
ASPnoob19-Aug-07 19:18
ASPnoob19-Aug-07 19:18 
AnswerRe: Problem with Global asax file Pin
Christian Graus19-Aug-07 20:46
protectorChristian Graus19-Aug-07 20:46 
QuestionInserting into SQL problem ! Pin
mrkeivan19-Aug-07 19:07
mrkeivan19-Aug-07 19:07 
AnswerRe: Inserting into SQL problem ! Pin
yuvachandra19-Aug-07 19:32
yuvachandra19-Aug-07 19:32 
GeneralRe: Inserting into SQL problem ! Pin
mrkeivan20-Aug-07 0:17
mrkeivan20-Aug-07 0:17 
AnswerRe: Inserting into SQL problem ! Pin
N a r e s h P a t e l19-Aug-07 19:59
N a r e s h P a t e l19-Aug-07 19:59 
QuestionCheck Box Pin
kaushik49019-Aug-07 18:42
kaushik49019-Aug-07 18:42 
Questionaccessing all controls of a page.. Pin
hkchauhan19-Aug-07 18:41
hkchauhan19-Aug-07 18:41 
AnswerRe: accessing all controls of a page.. Pin
mani_iips21-Aug-07 22:12
mani_iips21-Aug-07 22:12 
QuestionUsing Multiviews Pin
duo!@#19-Aug-07 17:03
duo!@#19-Aug-07 17:03 
QuestionCreate and Download CSV file in asp.net Pin
HatakeKaKaShi19-Aug-07 16:40
HatakeKaKaShi19-Aug-07 16:40 
AnswerRe: Create and Download CSV file in asp.net Pin
Christian Graus19-Aug-07 16:56
protectorChristian Graus19-Aug-07 16:56 
GeneralRe: Create and Download CSV file in asp.net Pin
HatakeKaKaShi19-Aug-07 17:18
HatakeKaKaShi19-Aug-07 17:18 
Questionneed help on Image control in the datalist Pin
hurrem19-Aug-07 15:25
hurrem19-Aug-07 15:25 
AnswerRe: need help on Image control in the datalist Pin
Rama Krishna Vavilala19-Aug-07 15:32
Rama Krishna Vavilala19-Aug-07 15:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.