asp.net-mvc

how to make html.actionlink without text but with image inside.

it is simple html: <%-- <a href="?language=de"> <img src="/Images/Company/de.png" alt="Webseite auf Deutsch" style="border: 0;" /> </a> --%> i would like to make from them html.actionlink: <%= Html.ActionLink("", "ChangeCulture", "Account", new { lang = "de", returnUrl = this.Request.RawUrl }, new { @style = "background-image: u...

Example of how to use active record with asp.net mvc

I am looking for the best approach to using NHibernate and MVC.net. I have gone through http://www.codeproject.com/KB/architecture/NHibernateArchitecture.aspx Someone has pointed to the use of Castle project Active record. My aim is to eliminate the need for any nhibernate dependencies within my domain. I want a quick and easy do...

show sub menu in asp.net mvc.

I am using MvcSiteMap.Core.dll in order to show sitemap in tab form.I want to show sun menu (in tab form) just beneath the parent tab.How to achieve this. ...

MbUnit's row attribute in NUnit?

While reading an Asp.Net MVC code sample that used MbUnit as it's testing framework, I saw that it was possible to run a single test against multiple input possibilities by using a Row attribute, like so: [Test] [Row("test@test_test.com")] [Row("sdfdf dsfsdf")] [Row("[email protected]")] public void Invalid_Emails_Should_Return_False(string in...

Whether to persist or not persist number of results per page. If we want to persist, how to persist.

In our application we are using ASP.NET MVC. On a page we are displaying 10 results per page by default. We want to let the user change this default value of 10 to 20 or 30 or 40. When it is changed, is it good to persist this changed value? To me it looks good to persist the value so that user does not have to change it every time. My ...

Errors where separating .Context.tt and .tt files from .edmx file

Hi there, I am using a MVC 2 web application with EF4. I created my .edmx file in MyProject.EntityModel. I used the POCO generater to create MyProjectModel.Context.tt and MyProjectModel.tt. I then moved MyProjectModel.Context.tt and MyProjectModel.tt files to another project called MyProject.Entities. I have another project for my M...

How do I create a ContentPlaceHolder for CSS in ASP.NET MVC?

In my MasterPages, I created a content place holder to insert a CSS file right after the ContentPlaceHolder for the title and before the one for the body. However, when I create a new View, the CSS ContentPlaceHolder shows up after the body one instead of before. How can I fix it so the CSS content place holder shows up in the correct ...

Model Binding property with implicit conversion from string to type

I have the following class: public class PostCode { public string Name { get; set; } public static implicit operator PostCode(string postCode) { return new PostCode {Name = postCode}; } } It forms part of an Address class which is the model for a helper template (EditorTemplates>Address.ascx). This helper tem...

tab and enter hit different submit button in html form (all browsers)

Hi I have an issue that appears in all browsers. I am working with ASP.NET MVC. My controller renders an html form with various submit buttons (the reason for this is explained in the Addendum below). Whilst tabbing sends the focus to the right submit button under the right circumstances, hitting enter seems to submit the form usin...

MVCContrib grid - sorting a custom column

Hello, Just started learning to use the grid so please excuse me for the possibly trivial question. How can I sort by a column that uses another table property? For ex. column.For(cust => cust.LinkedTable.someProperty).Sortable(true); definition results in a "Could not find a property called 'someProperty' on type MyProject.Models.Node...

halting a $.post

I have stolen/found/used/written and edited the following widget of jQuery for a auto-completing dropdown. (function($) { $.widget("ui.comboboxGemeenten", { _create: function() { var focushelper = false; var lastTerm; var self = this; var select = this.element.hide(); ...

Error in MVC application for Model in View

I am getting following error The model item passed into the dictionary is of type 'Helpers.PaginatedList`1[EntityLayer.Test]', but this dictionary requires a model item of type 'Helpers.PaginatedList`1[EntityLayer.Test]' And the stack trace is as follows at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value) at System.Web.Mvc....

How to read username and password from http GET in .NET MVC controller?

How can I read the username and password from http GET in .NET MVC controller? I am using a jQuery $.ajax call and I am passing username and password in as a setting. Is this secure? If my server is ASP.NET MVC 2 how can I retrieve the username and password from the request? My end goal is to make a secured jsonp call. here is ho...

asp.net MVC extending DataAnnotions

As well as DisplayName eg. [DisplayName("Address line 1 ")] public string Address1{get; set;} Html.LabelFor(model => model.Address1) I have a requirement to show tooltips eg. [DisplayName("Address line 1 ")] [ToolTip("The first line of your address as it appears on you bank statement")] public string Address1{get; set;} Html.Label...

Regular expression for checking the range of numeric values

I want to have a range between 0 to 65536 , what would be the regular expression for that? ...

Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil' in asp.net mvc

I am getting following error in production but the same is not a repro in in local. Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. Inner Exception: Exception of type 'System.Web.HttpUnhandledException' was thrown. Stack Trace: at System.Web.HttpServerUtility.Ex...

asp.net mvc reporting 2010

I think this question was asked for several times already, but since mvc is a new technology, I hope there is something new for it. is there something good for mvc, to do reports ? ...

MVC - fields in a partial View need a Unique Id. How do you do this?

In my view I render a partial view within a loop. The problem I have is that for each new row, the Id of the fields remains the same. I can I change this so that the Ids are unique and predictable? <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminAccounts.master" Inherits="System.Web.Mvc.ViewPage<SHP.WebUI.Models.Bank...

ASP.NET MVC A problem with passing a string object into View

Hi, I want to pass a string object into a View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<String>" %> <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <h2><%=Model %></h2> </asp:Content> When I try this: re...

Help with asp.net mvc https

I have my HomeController decorated with [RequireHttps], the problem is that my certificate is just on http://www.mysite.com Now, if people go to http://mysite.com they get an Untrusted Connection error (on Firefox) What can I do to prvent this from happening? ...