asp.net-mvc-5

How to pass Array to MVC Controller with Jquery?

若如初见. 提交于 2019-12-30 07:50:05
问题 I am beginner to develope .Net MVC 5 application. But I have some problem with passing array or object to controller with Jquery. I'm adding dynamically input fields with button. I want to pass input's data to controller. But I couldn't succeed. Html Section is like that; <div id='TextBoxesGroup'> <div id="TextBoxDiv1"> <label>Textbox #1 : </label><input type='text' id='textbox1'> </div> </div> <input type='button' value='Add Button' id='addButton'> <input type='button' value='Remove Button'

MVC 5 -> MVC 5.1 Migration. Intellisense issues

做~自己de王妃 提交于 2019-12-30 06:54:34
问题 I just updated my project to MVC 5.1 from MVC 5. The main web.config file got updated automatically, but web.config s under main View and Areas folders weren't changed. I suspect that's why now I lost both intellisense and resharper support for my actions, controllers and areas. Does anyone know correct web.config content for MVC 5.1 Views? Just replacing 3.0.0.0 to 3.1.0.0 and 5.0.0.0 -> 5.1.0.0 did not solve the issue. It happens in both Visual Studio 2012 and 2013 Professional. 回答1: Found

Calling JavaScript function in MVC 5 Razor view

回眸只為那壹抹淺笑 提交于 2019-12-30 06:30:06
问题 I have seen in another post that you can call a JavaScript function in your razor code like so: @:FunctionName() For me though this only outputs the actual words FunctionName() Here is my view: @model PriceCompare.Models.QuoteModel @{ ViewBag.Title = "Quote"; } <h2>Quote</h2> @if (@Model.clarify == true) { // do drop down loic @:ShowClarify(); } else { // fill quote @:ShowQuote(); } <div class="clarify"> You can see the clarify div </div> <div class="quote"> You can see the quote div </div>

DependencyResolver.SetResolver Not working

ⅰ亾dé卋堺 提交于 2019-12-30 04:40:27
问题 I'm trying to set the container on a new app using the Dependency.SetResolver method and using autofac with autofac mvc 5 integration. The problem is that setting the resolver doesn't appear to do anything. The default resolver will always be used and will always expect a default constructor. Any ideas? Edit - The global.asax.cs , I've simplified it down to: var b = new ContainerBuilder(); b.RegisterType<UserInfo>().As<IUserSession>().InstancePerHttpRequest(); var container = b.Build();

Does ASP.NET Identity 2 support anonymous users?

跟風遠走 提交于 2019-12-30 03:15:09
问题 I want to allow anonymous/not yet registered and registered users to post on my website. Posts (table) - Id (int) - Subject (nvarchar) - Body (nvarchar) - UserId (uniqueidentifier) The project uses the latest MS technologies (ASP.NET MVC 5+, C#...) How should I go about doing that? Is ASP.NET Identity even the right solution? What's the difference between these: ASP.NET Identity SimpleMembership Membership Provider Update I need to be able to differentiate not yet registered users and record

How to get Facebook first and last name values using ASP.NET MVC 5 and OWIN?

ⅰ亾dé卋堺 提交于 2019-12-29 14:17:11
问题 I know that a 'Name' field is provided, but I would prefer to access the first and last names explicitly. Can someone help with this? I'm still wrapping my head around ASP.Net MVC. 回答1: In your Startup.Auth.cs ConfigureAuth(IAppBuilder app) method, set the following for Facebook: var x = new FacebookAuthenticationOptions(); x.Scope.Add("email"); x.AppId = "*"; x.AppSecret = "**"; x.Provider = new FacebookAuthenticationProvider() { OnAuthenticated = async context => { context.Identity.AddClaim

MVC - Mixed Auth - OWIN + Windows Auth

穿精又带淫゛_ 提交于 2019-12-29 13:11:57
问题 I need to have both windows authentication and owin (forms) authentication but i can't get it to work. Probably the best option is to have two sites that have different authentication methods. I found a project that does what i want: MVC5-MixedAuth. But it uses IISExpress and i can't get it to work with Local IIS. The error that occurs is: Request filtering is configured on the Web server to deny the request because the query string is too long. If i remove all my ConfigureAuth() method

MVC - Mixed Auth - OWIN + Windows Auth

人盡茶涼 提交于 2019-12-29 13:10:01
问题 I need to have both windows authentication and owin (forms) authentication but i can't get it to work. Probably the best option is to have two sites that have different authentication methods. I found a project that does what i want: MVC5-MixedAuth. But it uses IISExpress and i can't get it to work with Local IIS. The error that occurs is: Request filtering is configured on the Web server to deny the request because the query string is too long. If i remove all my ConfigureAuth() method

Extending ASP.NET Identity Roles: IdentityRole is not part of the model for the current context

只愿长相守 提交于 2019-12-29 04:42:04
问题 I'm trying to use the new ASP.NET Identity in my MVC5 application, specifically I'm trying to integrate ASP.NET Identity into an existing database. I've already read the questions/answers on SO pertaining to DB First and ASP.NET Identity, and having followed all the recommendations I still can't add roles to my database, although I have no problems adding users. Here's my code: var context = new PayrollDBEntities(); var roleManager = new RoleManager<AspNetRole>(new RoleStore<AspNetRole>

Email Confirmation with MVC 5 and Asp.net Identity

↘锁芯ラ 提交于 2019-12-29 03:18:49
问题 I have been searching, but have not found any documentation on how to implement Email confirmation with MVC 5 using the new ASP.net Identity. There does not seem to be any documentation on this topic (that I could find). Has anyone solved this yet? I am very surprised that this is not included by default in the default MVC 5 project. Any guidance is greatly appreciated. Thank You 回答1: I have written a step-by-step article on how to add email confirmation when using ASP.NET Identity. You can