asp.net-mvc-5

Foundation 5 Datepicker failing, or is it me

孤街醉人 提交于 2019-12-12 12:38:15
问题 OK, I am running FOundation 5 with SASS I downloaded the Datepicker by Peter Beno here: https://github.com/najlepsiwebdesigner/foundation-datepicker Now I know that it says it is made for Foundation 4, but I see no reason why it won't work in Foundation 5. Yeah the javascript is a bit over my head, but that it why I'm using someone elses date picker. Here are the steps I took to implement this datepicker into Foundation 5. 1) I renamed the foundation-datepicker.js to foundation.datepicker.js

MethodAccessException inside System.Web.WebPages migrating mvc 3 to mvc 5

大憨熊 提交于 2019-12-12 11:13:22
问题 Using Visual Studio 2013, I migrated a hybrid Asp.Net Webforms/MVC 3/Framework 4.0 web application to Asp.Net Webforms/MVC 5.2.2/Framework 4.5.1. I followed the steps outlined in these links: http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/upgrading-signalr-1x-projects-to-20 When I run the application in visual studio I get this error: Attempt

How to delegate Windows Authentication session when running an app on IIS 8?

。_饼干妹妹 提交于 2019-12-12 10:35:15
问题 I have an intranet application written with c# on the top of ASP.Net MVC 5 Framework. My app is configured to authenticate users via "Windows Authentication" method. This app is running on IIS 8. My app uses a third party SDK to interact with another program I have running on the same domain. This third party app allows the user to login using Windows Authentication also via the provided SDK. Problem However the server where the SDK is communication with is always returning "Invalid user name

How can I isolate users' data in ASP.net MVC application?

試著忘記壹切 提交于 2019-12-12 09:52:48
问题 So I have an asp.net application (using MVC5, ASP 4.5, EF) deployed on Azure. The application allows users to register and login. However, once logged in, anyone can see everyone else's data. What is the best practice to isolate the data belonging to different users so that each user can only see the data he/she creates? Another small question is how does Facebook separates its users' data? Thanks 回答1: For every piece of data a user creates, store their user ID and only allow users to see

How to retrieve Users with a specific role via Linq in ASPnet Identity

谁说胖子不能爱 提交于 2019-12-12 09:49:31
问题 I need to retrieve all users of a specific role, something I think should be made straightforward, however, here is the problem. The Roles navigation Property of ApplicationUser is not the list of roles (IdentityRole) but a collection of (IdentityUserroles) the intermediate table that links users and roles. So, this is the code I have, but it does not work. [HttpPost] [Authorize(Roles = "Admin, Recepcionista, Orientador")] public ActionResult SearchResults(SearchCriteriaViewModel criteria) {

Displaying HTML String from Model in MVC Razor View

◇◆丶佛笑我妖孽 提交于 2019-12-12 09:37:44
问题 I have a Model filed that returns an HTML string with line break BR tag, but How do I display that HTML on the browser ? The problem ins instead putting the line break, the Tag itself displaying on the UI I tried to put the model within Html.Raw(modelItem => item.Speaking), but it never works as it expecting a string inside, and Cannot convert lambda expression to type 'string' because it is not a delegate type Below is the code and comments what I've tried. <div> @{ string strTest = "<br/

What is the recommended approach for deploying to multiple Azure environments (dev, test, production)?

感情迁移 提交于 2019-12-12 09:00:01
问题 I have an C# web application using mvc5. It currently runs on Azure and I have a dev, test, and production instances. What do I need to do to ensure that the database connection strings will automatically change as the application is pushed to each environment? I know this is possible with web.config as you can define Web.Debug.Config, etc, but how would I go about this for different worker roles on Azure? I have been all over the internet looking for a solution. In a nutshell, I would like

Passing multiple models from View to Controller in asp MVC 5

自古美人都是妖i 提交于 2019-12-12 07:02:38
问题 Update here is my solution that worked for me: I create two sub views one for Model1 and one for Model2 and in the big view model I render them by : @{Html.RenderPartial("view1", Model.model1);} @{Html.RenderPartial("view2", Model.model2);} and in the controller I have Action method like this BigViewModel model= new BigViewModel(); return View(model); and I have Action method for posting like this : [HttpPost] public ActionResult fun(Model1 model1,Model2 model2) { //Logic go here } ==========

ASP.Net MVC: How to generate html table using editorfor and editor template

泄露秘密 提交于 2019-12-12 06:49:28
问题 still now i generate html table like below code example but interested to know how could i generate html table using editorfor using editor template see my full razor and view model code and guide me how to achieve my goal. @model MVCCRUDPageList.Models.StudentListViewModel @{ ViewBag.Title = "Index"; } <h2>CREATE TABULAR UI WITH HTML TABLE</h2> @using (Html.BeginForm("Index", "HtmlTable", FormMethod.Post)) { <div class="form-group"> <div class="col-md-12 table-responsive"> <table class=

How to open MVC5 view from aspx page

匆匆过客 提交于 2019-12-12 06:46:41
问题 Ive got an aspx file on the root of web application MVC5 project. I can go from Mvc View to the aspx file but im stuck on going back to mvc view . How do i go back from button event in Aspx ? Fyi, this is just an empty project as im trying to learn on MVC. So everything is left as it is. Default configuration. The only difference that ive made is add redirect to the aspx page inside Home controller ActionResult. Folder Structure and redirect code. p/s. If you are wondering why i used an aspx