asp.net-mvc-5

Direct download link to ASP.NET MVC 5 for VS 2012 [closed]

∥☆過路亽.° 提交于 2019-12-05 12:31:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm looking for a direct link to ASP.NET MVC 5 install package for Visual Studio 2012, in downloads of asp.net i found only packages with Azure, but i need package without it. 回答1: Per this Stackoverflow answer, and one of the responses to this Razor Intellisense bug, Microsoft does not plan on shipping tooling

How to create a security stamp value for asp.net identity (IUserSecurityStampStore)

自古美人都是妖i 提交于 2019-12-05 12:11:36
问题 In my MVC-5 application, I have to create security stamp values manually . The current implementation of the identity team seems to use a guid. Guid.NewGuid().ToString("D") Is it safe to create a new Guid myself to use as a new security stamp value or will this lead to problems in future implementations of asp.net identity? Is there a method to let the identity framework create such a stamp-value for me so that my implementation is safe for future changes? 回答1: Out of the documentation of the

Run a .Net MVC5 application on Mono

半城伤御伤魂 提交于 2019-12-05 12:06:56
I am developing an .Net 4.5.1 MVC5 application in Visual Studio 2013 on Windows. Now I want to know, if it is possible to run this application on Linux ( Ubuntu 12.04 )? Would it be possible to use OWIN? Owin can be run self hosted which means no IIS which is a start see here Use OWIN to Self-Host ASP.NET Web API Then to also help see this post about deploying to a mono instance on heroku Running OWIN/Katana apps on Heroku 来源: https://stackoverflow.com/questions/21455600/run-a-net-mvc5-application-on-mono

HtmlAttributes in Extension Method

折月煮酒 提交于 2019-12-05 11:17:26
I'm using MVC 5 and I'm trying to write some Bootstrap extention methods. My goal is to 'overwrite' the Html.ActionLink method with Html.BootstrapLinkButton . The BootstrapLinkButton method should generate a link with the css classes "btn btn-default" automatically attached. My code so far: public static MvcHtmlString BootstrapLinkButton(this HtmlHelper htmlHelper, string linkText,string actionName, string controllerName, object routeValues = null, object htmlAttributes = null) { var attributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); if (attributes.ContainsKey("class")) {

Is it possible to get the View name from within Layout?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 10:52:43
I'm trying to pull the name of the current View from within my Layout. Usually, VirtualPath is used for this. Unfortunately, this will return the path of the Layout file. Is there any way to get the name of the View that's returned by the controller? The following will get you the view name: ((RazorView)ViewContext.View).ViewPath; You can use ViewBag . Define a CurrentView property to it and use that. public ActionResult Create() { ViewBag.CurrentView = "Create"; return View(); } And in the layout, you can read and use it like <h2>@ViewBag.CurrentView</h2> Or if you want to get it into a

Web API 2 project and MVC 5 Website project in same domain

非 Y 不嫁゛ 提交于 2019-12-05 10:42:21
Technologies used: BreezeJS OData Web API 2 MVC 5 IDE: Visual Studio 2013 I've been wrestling with the idea of having a Web API project and a separate web site project in a single solution. My Web API 2 project opens up as: localhost:2020/ExampleProject.API My MVC 5 WebSite project opens up as: localhost:5050/ExampleProject.WebSite Now by default web api doesn't allow cross origin policies. So I played around with enabling CORS in my Web API 2, although I was able to get it to work, it only works for the latest browsers; I need the backward compatibility of IE7 to IE9. So I played around with

How to force only anonymous access to controller action?

喜夏-厌秋 提交于 2019-12-05 10:41:54
I can use the [AllowAnonymous] attribute to permit a user to access a controller action, but is there an attribute to permit only anonymous users to an action? e.g. [AllowAnonymousOnly] André Pena No. It doesn't exist. However, you can create it by creating your own attribute inheriting from the AuthorizeAttribute . Here's an example . Yours would look like: public class AllowAnonymousOnlyAttribute : AuthorizeAttribute { protected override bool AuthorizeCore(HttpContextBase httpContext) { // make sure the user is not authenticated. If it's not, return true. Otherwise, return false } } You

Why does my site redirect back to the Login screen when I click an external provider button?

纵饮孤独 提交于 2019-12-05 10:08:27
I'm upgrading an ASP.Net MVC4 site to MVC5, and implementing the new OWIN Authentication methods in the process. I've copied over the action methods from the Account controller on a blank MVC5 project. The problem is, when I click an external provider button (e.g. Google) I just get redirected back to the login page again. The second time I click it, I do get taken to the Google account page, but then the browser gets redirected to the Account/External login page. What's going on? Check the <authentication> element in your web.config file. It is probably still saying <authentication mode=

Is really QueryString case insensitive?

懵懂的女人 提交于 2019-12-05 09:42:19
I am working on a payment platform and, in response to a payment, a simple GET call, with some params in the query string, is made to my listener: http://localhost/mytest/listener?TIMECREATED=04.08.2015+12%3A22%3A27&statoattuale=OK&PREVIOUSSTATE=IN&CURRENTSTATE=payment_approved&tipomessaggio=PAYMENT_STATE& DESCRIZIONE =CAMBIO+DI+STATO&datacreazione=04.08.2015+12%3A22%3A27& stabilimento =xxxxxx& MerchantNumber =xxxxxx& descrizione =CAMBIO+DI+STATO&OBJECT=PAYMENT&TIMEGENERATED=04.08.2015+12%3A23%3A17& MERCHANTNUMBER =xxxxxx&statoprecedente=IN&MERCHANTACCOUNT=xxxxxx&numeroOrdine=myOrderNo

“The SMTP host was not specified.” - but it is specified?

我怕爱的太早我们不能终老 提交于 2019-12-05 09:18:55
问题 I'm slightly baffled here - I'm receiving the following error: The SMTP host was not specified. Even though my code appears to be correct (from what I can see). I am able to do it manually by including all the details inside of the controller, e.g. SmtpClient smtpClient = new SmtpClient("smtp.gmail.com"); smtpClient.Port = 587; ... etc But I shouldn't have to do this, as I want to use the details inside mailSettings (Making it re-usable for various different controllers). mailSettings in my