razor

ASP.NET Razor/Webmatrix sites logout user too quickly. How to change?

╄→гoц情女王★ 提交于 2020-01-04 09:57:11
问题 The WebSecurity component in Webmatrix is pretty slick, but users' sessions expire too quickly for me. It seems like it's measured in hours and I'd like the session timeout to be more in terms of days. How do I change the session timeout? 回答1: In answer to your question, you can set any value for session timeout in your web.config: <configuration> <system.web> <sessionState timeout="value_in_minutes"></sessionState> </system.web> </configuration> By default, sessions expire 20 minutes after

ASP.NET Razor/Webmatrix sites logout user too quickly. How to change?

主宰稳场 提交于 2020-01-04 09:56:26
问题 The WebSecurity component in Webmatrix is pretty slick, but users' sessions expire too quickly for me. It seems like it's measured in hours and I'd like the session timeout to be more in terms of days. How do I change the session timeout? 回答1: In answer to your question, you can set any value for session timeout in your web.config: <configuration> <system.web> <sessionState timeout="value_in_minutes"></sessionState> </system.web> </configuration> By default, sessions expire 20 minutes after

passing a string with line break on to a cshtml page

假装没事ソ 提交于 2020-01-04 09:09:11
问题 I have a mypage.cshtml as below <p><span>@r.get("My_Message")</span></p> Below is my entry in my resx file <data name="my_message" xml:space="preserve"> <value>This is first line <br/> This is my second line <br/></value> </data> When i run mypage.cshtml , my line break char for the above string is not working . please help The output I am getting is This is first line <br/> This is my second line <br/> I don't know why lines are not breaking I need an output as below This is first line This

passing a string with line break on to a cshtml page

梦想的初衷 提交于 2020-01-04 09:09:07
问题 I have a mypage.cshtml as below <p><span>@r.get("My_Message")</span></p> Below is my entry in my resx file <data name="my_message" xml:space="preserve"> <value>This is first line <br/> This is my second line <br/></value> </data> When i run mypage.cshtml , my line break char for the above string is not working . please help The output I am getting is This is first line <br/> This is my second line <br/> I don't know why lines are not breaking I need an output as below This is first line This

use images instead of text in webgrid asp mvc

为君一笑 提交于 2020-01-04 08:05:31
问题 How can I change the action links in this webgrid into images? ps: I want all the images to appear in the same column @{ var grid = new WebGrid(Model, canPage:true ,canSort:true, rowsPerPage :6); grid.Pager(WebGridPagerModes.NextPrevious); @grid.GetHtml(tableStyle: "webGrid", htmlAttributes: new { id = "datatable" }, headerStyle: "Header", alternatingRowStyle: "alt", columns: grid.Columns(grid.Column(header: "", format: (item) => new HtmlString( Html.ActionLink("Détails", "Details", new { id

Mixing Razor Views and Web Forms Master Pages

允我心安 提交于 2020-01-04 07:54:09
问题 I'm attempting to do what Scott Hanselman describes below: http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx I have a Web Form user control with code behind that is called from the Web Form and Razor Master Pages that is not working in the Razor layout: <div id="navtop"> @{ Html.RenderPartial("~/Controls/MasterPageMenu.ascx"); } </div> The user control contains the following: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MasterPageMenu.ascx

The controller for path '/' was not found or does not implement IController. in nopCommerce

大兔子大兔子 提交于 2020-01-04 06:50:12
问题 I am trying to call an action in HeaderLinks.cshtml razor view. @Html.Action("SideMenu","Index") SideMenuController is in a plugin that i installed on nopCommerce. All routing is good. routes.MapRoute("Nop.Plugin.Other.SideMenu.Log", "sidemenu/index", new { controller = "SideMenu", action = "Index" }, new[] { "Nop.Plugin.Other.SideMenu.Controllers" }); But the view is showing an error - "The controller for path '/' was not found or does not implement IController." I also tried with that...

The controller for path '/' was not found or does not implement IController. in nopCommerce

試著忘記壹切 提交于 2020-01-04 06:49:25
问题 I am trying to call an action in HeaderLinks.cshtml razor view. @Html.Action("SideMenu","Index") SideMenuController is in a plugin that i installed on nopCommerce. All routing is good. routes.MapRoute("Nop.Plugin.Other.SideMenu.Log", "sidemenu/index", new { controller = "SideMenu", action = "Index" }, new[] { "Nop.Plugin.Other.SideMenu.Controllers" }); But the view is showing an error - "The controller for path '/' was not found or does not implement IController." I also tried with that...

Represent string as currency or decimal using razor @Html.textboxfor

橙三吉。 提交于 2020-01-04 06:28:42
问题 I have an ASP.NET MVC App. I am building an HTML table using razor syntax. The page model is defined as @model IEnumerable < DealView.Models.deal > and the model has a property public string price { get; set; } which can be a number or null. I am trying to get the textbox for to show comma's (ie 1,000,000) or even better currency ($1,000,000). At the moment I am just getting (1000000) using @foreach (var item in Model) { <tr> ... <td>@Html.TextBoxFor(modelItem => item.price, new { id = string

What is the purpose of `area = “” ` in an Html.ActionLink?

谁说我不能喝 提交于 2020-01-04 05:48:07
问题 When I use Visual Studio 2013 to create a new MVC project, I notice that in the _Layout.cshtml file, there is a default link in the menu bar. @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) It all makes sense for me except the new { area = ""} part. Intellisense says that this parameter is for route values. I did a Google search for "Html.Actionlink route value area" (and other permutations), but was unable to find any simple