mvccontrib

Displaying a literal period following razor syntax

荒凉一梦 提交于 2019-12-12 13:30:51
问题 How can I escape the razor engine to print a literal period after my property value? The compiler is interpreting the period as to be followed by a method or property, so it throws an error that 'PDF' is not a valid property or method. col.Custom(@<a href="http://someurl/@item.INSTRUMENT_NUM.pdf">@item.INSTRUMENT_NUM</a>).Named("Instrument Number"); yellow screen of death Compiler Error Message: CS1061: 'string' does not contain a definition for 'pdf' and no extension method 'pdf' accepting a

MvcContrib.UI.Grid pagination problem

扶醉桌前 提交于 2019-12-12 01:30:36
问题 I have an object which contains quite a few other objects in an IList called possible values. I have successfully used the mvccontrib grid plus paging before but would like to add the grid to the object’s page – hope you know what I mean. So I did something like this in my controller: [AcceptVerbs(HttpVerbs.Get)] public ViewResult Bla(string Id, int? page) ViewData["PossibleValues"] = XYZ.PossibleValues.AsPagination(page ?? 1, 10); PossibleValues definitely contains data but not ViewData[

OnClick event on button in MvcContrib Grid column not working

爱⌒轻易说出口 提交于 2019-12-11 20:46:22
问题 I am new to mvc.I am using MvcContrib Html.Grid in my MVC 2 project.I have an existing Html.Grid where I have to added a new column with a button in it. The button will be enabled/disabled bsed on the "status" column in the grid. I managed to get the button in the column and enable/disable it based on the "status" column. Here's the code: column.For(c => c.Status == "Complete" ? "<input type=\"button\" value=\"PDF\" onClick=\"\" >" : "<input type=\"button\" value=\"PDF\" onClick=\"\" disabled

How to resolve an user repository using Windsor IoC at the start of the application?

无人久伴 提交于 2019-12-11 08:49:30
问题 I get an error message "Object reference not set to an instance of an object." when I try to use an UserRepos repository. Question is how can I resolve user repository at the start of the application (ASP.NET MVC) What is wrong here? public class MyApplication : HttpApplication { public IUserRepository UserRepos; public IWindsorContainer Container; protected void Application_Start() { Container = new WindsorContainer(); // Application services Container.Register( Component.For<IUserRepository

DRY in the MVC View

依然范特西╮ 提交于 2019-12-11 07:31:59
问题 I've been working a lot with asp.net web forms and one think that I like about the is the consistency with the generated markup e.g. if you create a composite control for a TextField you can control the generated markup in a single class like and don't break the SRP: <form:textfield id="firstName" runat="server" required="true" label="First Name" /> I you're your going to generate the markup by hand it might look like this: <label for="firstName" id="lbl_firstName">Name <span class="required"

Asp.net MVC GridView edit columns option

让人想犯罪 __ 提交于 2019-12-11 06:18:52
问题 I have the view : <%= Html.Grid(Model.data).Columns(column => { column.For(x => x.results) .Action(item => Html.ActionLink(item.results,"Edit").ToString(), item => Html.TextBox("result",item.results).ToString(), item => (Model.data == item)) .Named("Results"); column.For(x => x.refId) .Named("Reference ID"); column.For(x => x.fileLocation) .Named("File Location"); }) .Attributes(style => "width:100%", border => 1) And the controller looks like: public ActionResult Index() { // IEnumerable

Using Spring.Net to inject dependencies into ASP.NET MVC ActionFilters

百般思念 提交于 2019-12-11 02:25:06
问题 I'm using MvcContrib to do my Spring.Net ASP.Net MVC controller dependency injection. My dependencies are not being injected into my CustomAttribute action filter. How to I get my dependencies into it? Say you have an ActionFilter that looks like so: public class CustomAttribute : ActionFilterAttribute, ICustomAttribute { private IAwesomeService awesomeService; public CustomAttribute(){} public CustomAttribute(IAwesomeService awesomeService) { this.awesomeService= awesomeService; } public

MvcContrib Portable Areas View Intellisense?

╄→гoц情女王★ 提交于 2019-12-11 02:23:44
问题 I've started using Portable Areas from the MvcContrib project. Everything works great with the exception of Visual Studio Intellisense. Has anyone been able to get their View intellisense to work... Html. <-- does not exist in the current context. I'm also not able to get intellisense on any of the models created in the same project... 回答1: I have the following web.config under the View folder for each portable area and intellisense is working for me. This is using asp.net 4.0, but I am

Problem with razor view and mvccontrib grid pagination

为君一笑 提交于 2019-12-10 19:03:49
问题 I have the following partial view code @model IEnumerable<PDoc.Web.Models.UserDocModel> @using MvcContrib.UI.Grid; @using MvcContrib.UI.Pager; @using MvcContrib.Pagination; <div id="docList"> @Html.Grid(Model).Columns( column => { column.For( u => u.Description ).Named( "Description" ); column.For( u => u.FileName ).Named( "File name" ); column.For( u => u.FileSize ).Named( "Size" ); column.For( u => u.UploadDate.ToShortDateString() ).Named( "Upload Date" ); } ).Attributes( @class => "table

Overriding the default 'No Data' Message in MVCContrib Grid

岁酱吖の 提交于 2019-12-10 10:19:42
问题 Is it possible to override the default 'There is no Data available' message in MVCContrib Grid with a custom message? 回答1: <%= Html.Grid<SomeModelType>(Model) .Empty("Some custom message") ... %> 来源: https://stackoverflow.com/questions/3986528/overriding-the-default-no-data-message-in-mvccontrib-grid