Click here to Skip to main content
15,913,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: Call from of Another Projects Pin
Stefan Troschuetz21-Jan-07 0:04
Stefan Troschuetz21-Jan-07 0:04 
AnswerRe: Call from of Another Projects Pin
quiteSmart20-Jan-07 23:31
quiteSmart20-Jan-07 23:31 
GeneralRe: Call from of Another Projects Pin
jaganil20-Jan-07 23:56
jaganil20-Jan-07 23:56 
GeneralRe: Call from of Another Projects Pin
Bassam Saoud21-Jan-07 1:54
Bassam Saoud21-Jan-07 1:54 
QuestionRead Arabic Text file Pin
ALAQUNAIBI20-Jan-07 21:35
ALAQUNAIBI20-Jan-07 21:35 
AnswerRe: Read Arabic Text file Pin
Guffa21-Jan-07 2:50
Guffa21-Jan-07 2:50 
AnswerRe: Read Arabic Text file Pin
David Domingues22-Jan-07 4:48
David Domingues22-Jan-07 4:48 
QuestionNot authorized to login in VS2005 Pin
dabuskol20-Jan-07 21:30
dabuskol20-Jan-07 21:30 
Hi,

I created a new program in VS2005 c# and every time I logon to the page I encounter a message "You are not authorized" but I have the roles that is needed to login to the specific page.

If I removed the restriction in webconfig then it works though without authentication.

in my global.asax file
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 />
           Response.Write(id);<br />
           string[] roles = GetUserRole(id.Name);<br />
           HttpContext.Current.User = new GenericPrincipal("cf681743", roles);<br />
           Trace.Write("Roles are: " + roles.ToString());<br />
           }<br />
       }<br />
     }<br />
}


PS: IS there any simplified statements in global.asax, I am not sure with my codes
I just copied it from one of the example in the net.



Dabsukol

AnswerRe: Not authorized to login in VS2005 Pin
Christian Graus20-Jan-07 22:42
protectorChristian Graus20-Jan-07 22:42 
GeneralRe: Not authorized to login in VS2005 Pin
dabuskol20-Jan-07 22:57
dabuskol20-Jan-07 22:57 
GeneralRe: Not authorized to login in VS2005 Pin
Christian Graus21-Jan-07 0:23
protectorChristian Graus21-Jan-07 0:23 
Questionhow to know trap folder or drive accessing event Pin
jafernaqvi20-Jan-07 21:17
jafernaqvi20-Jan-07 21:17 
AnswerRe: how to know trap folder or drive accessing event Pin
coolestCoder20-Jan-07 21:38
coolestCoder20-Jan-07 21:38 
QuestionByte Conversion Pin
sajid.salim.khan20-Jan-07 20:48
sajid.salim.khan20-Jan-07 20:48 
AnswerRe: Byte Conversion Pin
Dominik Reichl20-Jan-07 21:28
Dominik Reichl20-Jan-07 21:28 
AnswerRe: Byte Conversion Pin
coolestCoder20-Jan-07 21:29
coolestCoder20-Jan-07 21:29 
QuestionSend Message For MdiApplication At C#.Net Pin
keshtgar20-Jan-07 20:06
keshtgar20-Jan-07 20:06 
AnswerRe: Send Message For MdiApplication At C#.Net Pin
coolestCoder20-Jan-07 21:32
coolestCoder20-Jan-07 21:32 
GeneralRe: Send Message For MdiApplication At C#.Net Pin
mwith21-Jan-07 3:38
mwith21-Jan-07 3:38 
Questionmethod overlap Pin
Basement Dweller20-Jan-07 19:42
Basement Dweller20-Jan-07 19:42 
AnswerRe: method overlap Pin
coolestCoder20-Jan-07 21:27
coolestCoder20-Jan-07 21:27 
AnswerRe: method overlap Pin
Christian Graus20-Jan-07 22:47
protectorChristian Graus20-Jan-07 22:47 
QuestionUnsafe() Blocks?? Pin
Rahithi20-Jan-07 19:35
Rahithi20-Jan-07 19:35 
AnswerRe: Unsafe() Blocks?? Pin
Christian Graus20-Jan-07 22:44
protectorChristian Graus20-Jan-07 22:44 
QuestionHelp importing XML data into forms Pin
TheBlindWatchmaker20-Jan-07 16:13
TheBlindWatchmaker20-Jan-07 16:13 

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.