asp.net-mvc-2 Questions
3
I am trying to create a minimum length validation attribute which will force users to enter the specified minimum amount of characters into a textbox
public sealed class MinimumLengthAttribute : ...
Jone asked 7/11, 2010 at 0:37
5
Solved
If I have a search object with a list of fields, can I, using the System.ComponentModel.DataAnnotations namespace, set it up to validate that at least one of the fields in the search is not null or...
Reunite asked 26/4, 2010 at 10:0
9
Solved
I have a partial view that is rendered within a main view. The partial view takes advantage of System.ComponentModel.DataAnnotations and Html.EnableClientValidation().
A link is clicked, and div ...
Petrolatum asked 9/5, 2010 at 17:3
3
Solved
Wanting to create custom data annotation validation. Are there any useful guides / samples on how to create them?
Firstly:
StringLength with minimum and maximum length. I'm aware .NET 4 can do thi...
Jena asked 5/8, 2010 at 10:13
5
Solved
In listing controller I have,
public ActionResult GetByList(string name, string contact)
{
var NameCollection = Service.GetByName(name);
var ContactCollection = Service.GetByContact(contact)...
Agamemnon asked 8/6, 2011 at 12:29
6
Solved
I'm using Visual Studio 2008 Pro.
I'm probably missing something very obvious here, but I've been trying to get the CTP for Sql Server compact 4 to work in my asp.net mvc application. I can find ne...
Sock asked 11/7, 2010 at 14:19
3
Solved
Other than the type it returns and the fact that you call it differently of course
<% Html.RenderPartial(...); %>
<%= Html.Partial(...) %>
If they are different, why would you call ...
Hyacinth asked 28/4, 2010 at 13:28
3
Solved
When we post the form using below to Action Method, we can see the View Model values in Parameter.
@Html.EditorFor(model => model.Foo)
When we post the form using below to Action Method, we c...
Betancourt asked 24/8, 2013 at 20:4
13
Solved
Simple question, if you use the Html Helper from ASP.NET MVC Framework 1 it is easy to set a default value on a textbox because there is an overload Html.TextBox(string name, object value). When I ...
Klagenfurt asked 14/6, 2010 at 4:41
7
I've seen a number of options for adding GZIP/DEFLATE compression to ASP.Net MVC output, but they all seem to apply the compression on-the-fly.. thus do not take advange of caching the compressed c...
Involve asked 30/9, 2010 at 18:33
4
Solved
In Asp.net MVC the url structure goes like
http://example.com/{controller}/{action}/{id}
For each "controller", say http://example.com/blog, there is a BlogController.
But my {controller} porti...
Ilmenite asked 21/7, 2010 at 20:57
5
Solved
I'll be tackling writing a custom date validation class tomorrow for a meeting app i'm working on at work that will validate if a given start or end date is A) less than the current date, or B) the...
Recession asked 31/8, 2010 at 23:59
8
Solved
Good day!
I've such method to get [DisplayName] attribute value of a property (which is attached directly or using [MetadataType] attribute). I use it in rare cases where I need to get [DisplayNam...
Incautious asked 29/3, 2011 at 14:47
4
Solved
I am uploading the file by using file upload option. And i am directly send this file from View to Controller in POST method like,
[HttpPost]
public ActionResult Page2(FormCollection objCollecti...
Defence asked 16/4, 2013 at 6:17
4
I want to add a ModelState error, like so:
ModelState.AddModelError("", "Some message, <a href="/controller/action">click here</a>)
However, the link doesn't get encoded, and so is d...
Microgroove asked 9/7, 2011 at 22:59
2
Solved
Required field validation not firing.
Model:
public class Client
{
[Required(ErrorMessage="Name Required")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string Name { get; set; }
...
Fogel asked 29/4, 2013 at 2:25
3
Solved
I have written a Custom Model Binder which is supposed to map Dates, coming from URL-Strings (GET) according to the current culture (a sidenote here: the default model binder does not consider the ...
Blanchette asked 20/6, 2011 at 13:35
12
Solved
I have just deployed my asp.net mvc-2 website to a server (using dotnetpanel). But getting this error
A default document is not configured for the requested URL, and directory browsing is not enab...
Myers asked 11/1, 2011 at 5:36
5
I have a problem with an ASP.NET MVC site.
These are the details:
ASP.NET MVC 2
ASP.NET 4 integrated pipeline
IIS 7.5 on Windows Web Server 2008 R2
Whenever I make a request for the app I get ...
Twayblade asked 4/8, 2011 at 12:49
4
Solved
I have an MVC route that is giving me hell on a staging server running IIS. I am running Visual Studio 2010's development server locally.
Here is a sample URL that actually works on my dev box:
R...
Given asked 30/7, 2010 at 22:20
2
Solved
How can I generate action link with custom html inside.
Like following:
<a href="http://blah-blah/.....">
<span class="icon"/>
New customer
</a>
Sheng asked 7/10, 2010 at 7:31
4
I have a problem with validation in ASP.NET MVC 2.0. I use the same Action in Controller to perform user request.
For example:
public ActionResult Index(ReportModel model)
{
if (!model.IsInitial...
Stockist asked 18/3, 2011 at 3:42
9
Solved
I have a shared master page which I am using from 2 different areas in my mvc 2 app. The master page has an action link which currently specifies the controller and action, but of course the link d...
Attitudinize asked 10/1, 2010 at 6:10
3
Solved
I have a list box in my page..
<td><%=Html.ListBox("listServiceTypes", Model.ServiceTypeListAll, new { style = "width: 500px;height:200px;" })%>
I need to disabled selecting multiple...
Aromatize asked 9/12, 2010 at 20:48
7
Solved
I am trying to determine dynamically the content/type of a input file. If I would be in a windows application I could write code like this (from this blog)
private string GetContentType(string fil...
Communize asked 2/1, 2011 at 0:17
© 2022 - 2024 — McMap. All rights reserved.