Click here to Skip to main content
15,889,863 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Content binding Pin
User 418025410-Jul-15 11:58
User 418025410-Jul-15 11:58 
AnswerRe: Content binding Pin
Richard MacCutchan10-Jul-15 21:21
mveRichard MacCutchan10-Jul-15 21:21 
QuestionA connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Pin
Member 118251139-Jul-15 2:04
Member 118251139-Jul-15 2:04 
AnswerRe: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Pin
Herman<T>.Instance13-Jul-15 0:15
Herman<T>.Instance13-Jul-15 0:15 
QuestionSingle quote character in query string causes SQL injection Pin
Stephen Holdorf8-Jul-15 11:07
Stephen Holdorf8-Jul-15 11:07 
AnswerRe: Single quote character in query string causes SQL injection Pin
Paulo Zemek8-Jul-15 12:08
mvaPaulo Zemek8-Jul-15 12:08 
AnswerRe: Single quote character in query string causes SQL injection Pin
Richard Deeming9-Jul-15 1:54
mveRichard Deeming9-Jul-15 1:54 
QuestionMVC Role users error instance Pin
DPaul19948-Jul-15 8:39
DPaul19948-Jul-15 8:39 
I created a few roles for users and I'm trying to assing a role to a specific user but I get this error:
<pre lang="c#">An exception of type 'System.NullReferenceException' occurred in Microsoft.Owin.Host.SystemWeb.dll but was not handled in user code

Additional information: Object reference not set to an instance of an object.

If there is a handler for this exception, the program may be safely continued.
and
C#
Line 47:             get
Line 48:             {
Line 49:                 return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
Line 50:             }
Line 51:             private set

In AccountController I don't have anything for this option. This is the function from Controller that should assing the role:
[HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult RoleAddToUser(string UserName, string RoleName)
        {
            ApplicationUser user = context.Users.Where(u => u.UserName.Equals(UserName, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault();
            var account = new AccountController();
            account.UserManager.AddToRole(user.Id, "RoleName");

<pre>
        ViewBag.ResultMessage = "Role created successfully !";

        // prepopulat roles for the view dropdown
        var list = context.Roles.OrderBy(r => r.Name).ToList().Select(rr => new SelectListItem { Value = rr.Name.ToString(), Text = rr.Name }).ToList();
        ViewBag.Roles = list;

        return View("ManageUserRoles");
    }</pre>

Where is the mistake?
AnswerRe: MVC Role users error instance Pin
Herman<T>.Instance13-Jul-15 0:18
Herman<T>.Instance13-Jul-15 0:18 
QuestionConnection to vpn using .bat file Pin
vineet13047-Jul-15 7:58
vineet13047-Jul-15 7:58 
AnswerRe: Connection to vpn using .bat file Pin
ZurdoDev7-Jul-15 8:02
professionalZurdoDev7-Jul-15 8:02 
QuestionUsing Entity Framework on a Web Forms Website Pin
jkirkerx6-Jul-15 6:23
professionaljkirkerx6-Jul-15 6:23 
QuestionSingle Page Application based on .NET Pin
Ishwor Khanal3-Jul-15 17:05
Ishwor Khanal3-Jul-15 17:05 
AnswerRe: Single Page Application based on .NET Pin
Abhinav S7-Jul-15 16:46
Abhinav S7-Jul-15 16:46 
QuestionXmlTextWriter.Create(MemoryStream, xmlSettings) Pin
jkirkerx3-Jul-15 9:32
professionaljkirkerx3-Jul-15 9:32 
QuestionThe message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available Pin
Kushal Gupta2-Jul-15 22:12
Kushal Gupta2-Jul-15 22:12 
AnswerRe: The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available Pin
Abhinav S2-Jul-15 22:54
Abhinav S2-Jul-15 22:54 
Questiondisplay day name of selected date Pin
Praveen Kandari2-Jul-15 21:36
Praveen Kandari2-Jul-15 21:36 
AnswerRe: display day name of selected date Pin
Abhinav S2-Jul-15 22:52
Abhinav S2-Jul-15 22:52 
GeneralRe: display day name of selected date Pin
Praveen Kandari2-Jul-15 23:39
Praveen Kandari2-Jul-15 23:39 
QuestionASP.NET MVC4 / WebAPI OAuth - DotNetOpenAuth Pin
Jammer30-Jun-15 4:11
Jammer30-Jun-15 4:11 
QuestionCan any one help me to post content on linked in asp.net? Pin
Raghavendra.Kodimala29-Jun-15 21:19
professionalRaghavendra.Kodimala29-Jun-15 21:19 
AnswerRe: Can any one help me to post content on linked in asp.net? Pin
deepankarbhatnagar6-Jul-15 1:10
professionaldeepankarbhatnagar6-Jul-15 1:10 
QuestionCode or a network stack control to change the network gateway inside my app Pin
Michael Clinton29-Jun-15 12:14
Michael Clinton29-Jun-15 12:14 
QuestionFormat Excel Row Height Pin
Hellfire123128-Jun-15 17:54
Hellfire123128-Jun-15 17:54 

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.