Click here to Skip to main content
15,671,134 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionI have a form with a gridview. When clicking one row I want it to pass the data to a second form that already exist. Pin
Paul Hacker5-Oct-15 7:51
Paul Hacker5-Oct-15 7:51 
QuestionCan't load data from SQL Compact Edition database - MVC 4 Pin
Member 120616005-Oct-15 0:45
Member 120616005-Oct-15 0:45 
QuestionI can download file from listbox but I want it to save in specific folder in local... Pin
Member 120161064-Oct-15 23:15
Member 120161064-Oct-15 23:15 
AnswerRe: I can download file from listbox but I want it to save in specific folder in local... Pin
JHizzle5-Oct-15 0:41
JHizzle5-Oct-15 0:41 
QuestionI want to download file from list box. Could anyone help? Pin
Member 120161064-Oct-15 20:07
Member 120161064-Oct-15 20:07 
AnswerRe: I want to download file from list box. Could anyone help? Pin
Richard MacCutchan4-Oct-15 22:05
mveRichard MacCutchan4-Oct-15 22:05 
GeneralRe: I want to download file from list box. Could anyone help? Pin
Member 120161064-Oct-15 22:51
Member 120161064-Oct-15 22:51 
QuestionVS2015 - MVC - Getting a list of users for Admin Panel Pin
DeerBear3-Oct-15 2:05
DeerBear3-Oct-15 2:05 
Hello!

I have created a project intended to get a better understanding of how to create an admin panel for users and seed data. It seems to me that seeding is now working as intended, but the admin panel for users is a bit more complicated than I thought it would be.

Let's start by saying I have already looked at this
tutorial on the topic but I find it's geared to such a different workflow than mine that trying to adapt it without having a firm grasp on the topic would be a lot more work than having something basic working for my own. The main issues I have with that article is that it is entirely based on the idea that users cannot register from the outside(which I instead want) and it is a preparation for another article to manage user groups (that I do not need at the moment).

From Googling, I realised that I need a couple of ViewModels, so I created them:

public class UserViewModel
    {
        [Required]
        [Display(Name = "Email")]
        [EmailAddress]
        public string Email { get; set; }

        [Required]
        [Display(Name = "Enabled")]
        public Boolean Enabled {get; set; }
        [Required]
        [Display(Name ="Active")]
        public Boolean Active { get; set; }
        [Required]
        [Display(Name = "Lockout date and time")]
        public DateTime? LockoutEndDateUtc { get; set; }
        [Required]
        [Display(Name ="Lockout enabled")]
        public Boolean LockoutEnabled { get; set; }
    }

    public class UserListViewModel
    {
        private ICollection<UserViewModel> _UserList = new List<UserViewModel>();
        public UserListViewModel( ApplicationDbContext ctx)
        {
            UserViewModel User;
            foreach (var user in ctx.Users)
            {
                User = new UserViewModel();
                User.Email = user.Email;
                User.Active = user.Active;
                User.Enabled = user.Enabled;
                User.LockoutEnabled = user.LockoutEnabled;
                User.LockoutEndDateUtc = user.LockoutEndDateUtc;
            }
        }


Trying to create a controller, however, resulted in VS kicking and screaming that there is no key. Googling again, it appears that VS thinks I am creating new database entities(something that I am not trying to do, promise!!!).

My understanding is that at least part of the reason for this is that I have a dbcontext in the constructor.

I am fairly a newbie in ASP.NET MVC, so I would like you to please show me the error of my ways.

Thanks!

A
Questionuse Ajax controls in handlebar template with HandelBar & Asp.net & Ajax Pin
mahadevkarekar2-Oct-15 1:22
mahadevkarekar2-Oct-15 1:22 
QuestionOpen files from listbox file listing in c# Pin
Member 120161061-Oct-15 17:26
Member 120161061-Oct-15 17:26 
AnswerRe: Open files from listbox file listing in c# Pin
Wendelius1-Oct-15 17:42
mentorWendelius1-Oct-15 17:42 
GeneralRe: Open files from listbox file listing in c# Pin
Member 120161061-Oct-15 17:58
Member 120161061-Oct-15 17:58 
GeneralRe: Open files from listbox file listing in c# Pin
Member 120161061-Oct-15 20:42
Member 120161061-Oct-15 20:42 
GeneralRe: Open files from listbox file listing in c# Pin
Wendelius1-Oct-15 21:02
mentorWendelius1-Oct-15 21:02 
GeneralRe: Open files from listbox file listing in c# Pin
Member 120161061-Oct-15 21:14
Member 120161061-Oct-15 21:14 
QuestionApp_GlobalResources and resx files, cannot find appropriate culture Pin
jkirkerx1-Oct-15 9:34
professionaljkirkerx1-Oct-15 9:34 
Answer[Solved] Re: App_GlobalResources and resx files, cannot find appropriate culture, masterpage Pin
jkirkerx1-Oct-15 13:50
professionaljkirkerx1-Oct-15 13:50 
Questionstart date end date not working Pin
Ekrem Tapan30-Sep-15 23:43
Ekrem Tapan30-Sep-15 23:43 
AnswerRe: start date end date not working Pin
Wendelius1-Oct-15 8:40
mentorWendelius1-Oct-15 8:40 
QuestionI wanted to upload Multiple Files With ListBox in ASP.NET Pin
Member 1201610630-Sep-15 16:33
Member 1201610630-Sep-15 16:33 
AnswerRe: I wanted to upload Multiple Files With ListBox in ASP.NET Pin
aarif moh shaikh1-Oct-15 0:29
professionalaarif moh shaikh1-Oct-15 0:29 
GeneralRe: I wanted to upload Multiple Files With ListBox in ASP.NET Pin
Member 120161061-Oct-15 17:12
Member 120161061-Oct-15 17:12 
GeneralRe: I wanted to upload Multiple Files With ListBox in ASP.NET Pin
Member 120161061-Oct-15 17:23
Member 120161061-Oct-15 17:23 
QuestionDisplay Image from MSSQL database into asp.net page using vb Pin
caffrey_130-Sep-15 4:52
caffrey_130-Sep-15 4:52 
AnswerRe: Display Image from MSSQL database into asp.net page using vb Pin
Wendelius30-Sep-15 5:01
mentorWendelius30-Sep-15 5:01 

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.