asp.net-mvc-5.1

SignOut of claims authentication

ε祈祈猫儿з 提交于 2021-01-29 20:27:35
问题 I have successfully implemented claims authentication in to my project. As shown here: var userCredentials = new[] { new Claim("UserId", userProfile.UserId.ToString()), new Claim("Username", userProfile.UserName)}; var id = new ClaimsIdentity(userCredentials, "Forms"); var cp = new ClaimsPrincipal(id); var token = new SessionSecurityToken(cp); var sam = FederatedAuthentication.SessionAuthenticationModule; sam.WriteSessionTokenToCookie(token); Which is working correctly, the issue I'm trying

Can EF6 generate my model objects from a ref cursor returned by an oracle stored procedure

让人想犯罪 __ 提交于 2020-01-16 05:47:05
问题 Can EF6 generate my model objects from a ref cursor returned by an oracle stored procedure?? So my current workplace is in the middle of a switch from using webforms to MVC5. We would like to use EF6 and Oracle stored procedures. A lot of the models that we want to implement will be selecting data from multiple tables(our database is massive). We already have some stored procedures already as well. I either need to be able to tell EF6 to map my models to the results of a stored procedure or

MvcSiteMapProvider Menu with Filter Attributes in the Controller Class in Asp.Net Mvc 5

守給你的承諾、 提交于 2020-01-15 11:22:08
问题 I am using this lib: https://github.com/maartenba/MvcSiteMapProvider I want to have a menu structure like this: <ul> <li><a href="/">Home</a></li> <li> <a href="#">Stuff</a> <ul> <li><a href="/Stuff/"<li> <li><a href="/Stuff/Add"<li> </ul> </li> </ul> I am using MvcSiteMapNode without xml; just with the decorator's way. So I have this Controller: [MvcSiteMapNode(Title = "Stuff", ParentKey = "root", Key = "stuff-key", Url = "#", ImageUrl = "fa-stuff")] public class StuffController : Controller

MvcSiteMapProvider Menu with Filter Attributes in the Controller Class in Asp.Net Mvc 5

白昼怎懂夜的黑 提交于 2020-01-15 11:21:47
问题 I am using this lib: https://github.com/maartenba/MvcSiteMapProvider I want to have a menu structure like this: <ul> <li><a href="/">Home</a></li> <li> <a href="#">Stuff</a> <ul> <li><a href="/Stuff/"<li> <li><a href="/Stuff/Add"<li> </ul> </li> </ul> I am using MvcSiteMapNode without xml; just with the decorator's way. So I have this Controller: [MvcSiteMapNode(Title = "Stuff", ParentKey = "root", Key = "stuff-key", Url = "#", ImageUrl = "fa-stuff")] public class StuffController : Controller

Asp.net razor textbox array for list items

隐身守侯 提交于 2020-01-09 11:09:17
问题 I can't find or figure out how to take a list of items (cupcakes) and display them in razor with a quantity field. What is happening is I am not able to get the values for each cupcake quantity in the list. Can you do textbox arrays in Razor? VIEW <div class="form-group"> <label>Cupcakes</label> @foreach (var cupcake in Model.CupcakeList) { @Html.TextBox("CupcakeQuantities", cupcake.Id) @cupcake.Name <br/> } </div> MODEL public List<Cupcake> CupcakeList { get; set; } public List<int>

Asp.net razor textbox array for list items

时光总嘲笑我的痴心妄想 提交于 2020-01-09 11:04:05
问题 I can't find or figure out how to take a list of items (cupcakes) and display them in razor with a quantity field. What is happening is I am not able to get the values for each cupcake quantity in the list. Can you do textbox arrays in Razor? VIEW <div class="form-group"> <label>Cupcakes</label> @foreach (var cupcake in Model.CupcakeList) { @Html.TextBox("CupcakeQuantities", cupcake.Id) @cupcake.Name <br/> } </div> MODEL public List<Cupcake> CupcakeList { get; set; } public List<int>

I can login only when user's UserName is exacly the same Email in database

我的未来我决定 提交于 2020-01-05 22:36:54
问题 I created fresh ASP .NET MVC 5 web application with individual accounts(default template). When I create user if I give him different UserName and Email I cannot login. If Email and UserName are the same I can login. I used default template. What I need change to let UserName and Email be different? Put in other words: The problem is that I can login only the user which have UserName and Email properties equal. Put in other other words: There are two users, one have: Email:mailbox@gmail.com ,

I can login only when user's UserName is exacly the same Email in database

余生颓废 提交于 2020-01-05 22:33:16
问题 I created fresh ASP .NET MVC 5 web application with individual accounts(default template). When I create user if I give him different UserName and Email I cannot login. If Email and UserName are the same I can login. I used default template. What I need change to let UserName and Email be different? Put in other words: The problem is that I can login only the user which have UserName and Email properties equal. Put in other other words: There are two users, one have: Email:mailbox@gmail.com ,

Invoking a controller's action by button in View without redirecting to any view

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 14:33:31
问题 I wanted to add a button to my ASP .NET MVC WebApplication's view which will invoke a method: public void UpdateDatabase(int personId, int surveyId) { //updating,modifying database } but besides that nothing at all will happen so user will not see any visible changes. The user will not be redirected, visible content of the site will not change, page will not be reloaded. Just like you click a button with no listener associated with it. I have tried <p> @Html.ActionLink("Update database",