Click here to Skip to main content
15,891,136 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionupdate a row in gridview when checkbox is checking (using button) Pin
Member 1036798129-Jan-14 12:12
Member 1036798129-Jan-14 12:12 
AnswerRe: update a row in gridview when checkbox is checking (using button) Pin
Member 1036798129-Jan-14 12:17
Member 1036798129-Jan-14 12:17 
AnswerRe: update a row in gridview when checkbox is checking (using button) Pin
Richard Andrew x6429-Jan-14 14:07
professionalRichard Andrew x6429-Jan-14 14:07 
AnswerRe: update a row in gridview when checkbox is checking (using button) Pin
vishal.gavle29-Jan-14 20:29
vishal.gavle29-Jan-14 20:29 
QuestionMove items between 2 asp listbox with SQL Data Source and double click event Pin
Member 775837529-Jan-14 5:16
Member 775837529-Jan-14 5:16 
AnswerRe: Move items between 2 asp listbox with SQL Data Source and double click event Pin
Kornfeld Eliyahu Peter29-Jan-14 6:19
professionalKornfeld Eliyahu Peter29-Jan-14 6:19 
AnswerRe: Move items between 2 asp listbox with SQL Data Source and double click event Pin
Prasad Vj2-Feb-14 1:47
professionalPrasad Vj2-Feb-14 1:47 
Questionuser role - web api Pin
miss78629-Jan-14 5:03
miss78629-Jan-14 5:03 
Dear all,

I am trying to construct a method, which can allow specific users to be redirected to their specific api controllers. I have come up with a psuedo-code however, I am little stuck implementing this method as i keep getting errors. Any help/advice would be very helpful.

C#
public class MultiController : ApiController
    {
        if (User.IsInRole("admin"))
    {

        [ActionName(BwicController)]
    }
    else (User.IsInRole("user"))
    {
        [ActionName(IntexController)]
    }

    }


This is the class where the user credentials are stored:
C#
public class PrincipalPro : IProvidePrincipal
    {

        private const string Username = "###";
        private const string Password = "###";

        public IPrincipal CreatePrincipal(string username, string password)
        {
            if (username != Username || password != Password)
            {
                return null;
            }

            var identity = new GenericIdentity(Username);

            IPrincipal principal = new GenericPrincipal(identity, new[] { "admin" });
            return principal;
        } 
    
    }

AnswerRe: user role - web api Pin
Deflinek30-Jan-14 0:24
Deflinek30-Jan-14 0:24 
GeneralRe: user role - web api Pin
miss78630-Jan-14 0:43
miss78630-Jan-14 0:43 
GeneralRe: user role - web api Pin
Deflinek30-Jan-14 2:27
Deflinek30-Jan-14 2:27 
GeneralRe: user role - web api Pin
miss78631-Jan-14 0:28
miss78631-Jan-14 0:28 
GeneralRe: user role - web api Pin
Deflinek31-Jan-14 2:19
Deflinek31-Jan-14 2:19 
QuestionIs it good to use Windows Service to schedule any operation on server side in ASP.Net MVC Pin
H.A.Baig28-Jan-14 18:53
H.A.Baig28-Jan-14 18:53 
AnswerRe: Is it good to use Windows Service to schedule any operation on server side in ASP.Net MVC Pin
Deflinek29-Jan-14 0:07
Deflinek29-Jan-14 0:07 
GeneralRe: Is it good to use Windows Service to schedule any operation on server side in ASP.Net MVC Pin
H.A.Baig29-Jan-14 1:39
H.A.Baig29-Jan-14 1:39 
GeneralRe: Is it good to use Windows Service to schedule any operation on server side in ASP.Net MVC Pin
Deflinek29-Jan-14 2:06
Deflinek29-Jan-14 2:06 
GeneralRe: Is it good to use Windows Service to schedule any operation on server side in ASP.Net MVC Pin
H.A.Baig29-Jan-14 7:22
H.A.Baig29-Jan-14 7:22 
QuestionHow does IIS handle http requests from different web clients to access the same web application? Pin
Ashok Natarajan27-Jan-14 22:41
professionalAshok Natarajan27-Jan-14 22:41 
SuggestionRe: How does IIS handle http requests from different web clients to access the same web application? Pin
Shameel27-Jan-14 22:46
professionalShameel27-Jan-14 22:46 
AnswerRe: How does IIS handle http requests from different web clients to access the same web application? Pin
londhess27-Jan-14 22:57
londhess27-Jan-14 22:57 
QuestionCan someone help me with HTML Editor Control Pin
Member 1025895227-Jan-14 20:21
Member 1025895227-Jan-14 20:21 
QuestionGetting latest files from TFS error Pin
vkEE27-Jan-14 5:29
vkEE27-Jan-14 5:29 
AnswerRe: Getting latest files from TFS error Pin
vkEE27-Jan-14 7:21
vkEE27-Jan-14 7:21 
AnswerPlease help me for online compiler for "c" language? Pin
prince_crazy26-Jan-14 4:21
prince_crazy26-Jan-14 4:21 

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.