Wondering if anyone has come across the following:
I have an ASP.NET MVC (v2) site.
If I hit /Home/Index, the home page is served correctly.
If I hit /Home/, the home page is served correctly.
If I hit /Home, the home page is served correctly UNLESS I'm using Internet Explorer, in which case I get a File Download dialog box wanting me ...
I am not sure what this is called. If know know what it's called you can edit this post.
asp.net mvc allows you to do this:
public ActionResult Index(FormCollection fc)
{
Item.Add(fc);
return View();
}
It is nice that in MVC the FormCollection object is automatically populated with the relevant data. Is there anything like ...
If i got a list of checkbox in a View, and this list came from Enum (flags). If my checkbox as all the same name, did my controller will update automaticly my Enum (flags) values in my ViewModel with multiple selection ?
Suppose i get in my View
<% foreach (var t in Enum.GetValues(typeof(FoodType)))
{
Respons...
We are revisiting our presentation tier architecture as a blueprint for future new, and re-written business systems (Just the presentation tier), using Microsoft technology stacks.
We have around 30 .NET systems (2, 3 and 3.5), about 60% of which are web based (CWAB + Web Forms) and 40% Smart Client (using CAB / SCSF, WinForms)
All syst...
Is it possible to create Ajax.ActionLink which has instead of text, the whole DIV?
I'd like to map div on Ajax.ActionLink
Thx in advance
...
I am working on this project which was created using ASP.NET MVC 2 RC.
The "Add" has disappeared when I right click on the files.
My problem is similar to this:
http://stackoverflow.com/questions/2136074/vs-2010-beta-2-asp-net-mvc2-project-cannot-add-areas
but the WalkThrough answer didn't help.
example: "Add" option is there for "Cont...
Is there a way to get the Request Object in a Html Helper Method.
I'd like to know if a file exists to replace non existent Files with a default Image.
Therefore i need the Request Object and it's Method MapPath(path).
Has anybody an idea.
Thx Thomas
...
I am modelbinding my session object. If i add the object in my action signature like so the object is bound and works correctly
public ActionResult Index(UserSession userSession)
{
Response.Write(userSession.CompanyImagePath); // this works
// other logic etc..
return View("Index", viewModel);
}
However i'd rather bind this on...
I pass two parameters to my repository to return one record
I am strugling to wite the code to return one record.
Here is my repository-
public Classifieds_Ads GetUserClassifiedDetailsToModify(int classifiedid, Guid UserGuid)
{
return context.Classifieds_Ads.Where(c => c.User.Id == UserGuid && c => c.CatID == cla...
I'm working on a new website, written in VB.Net using ASP.NET MVC2, there is a need to call "legacy" VB6 code for various complex bits of business logic. The VB6 is a framework consisting of many dlls and is very stateful, we are pretty much emulating how the framework is used in our client application, ie the application runs (lots of ...
Am pulling my hair out over this!
I have an ASP.NET MVC 2 web application, which up until yesterday was working fine on the hosted server (running IIS 7.5, I don't have direct access to IIS, just web portal access to some features).
Yesterday I attempted to install the ELMAH logging framework (see this article) and now all my routes ap...
I'm trying to create something simmilar to Builder and Factory patterns but operating on Views in ASP.MVC 2
Why this problem appears?
I've some model, which has many dependencies, which in turn affect on many parts of whole view of this input model.
What do I need?
Flexible way to build output view, from many parts which should depend ...
<%= Html.EditorFor(product => product.Name) %>
I need the generated output to have autocomplete="off" attribute set.
What I'm missing?
Edit:
I'm looking an extension method for EditorFor that accepts key/value dictionary for attributes, so I can call it like this: <%= Html.EditorFor(product => product.Name, new { autocomplete = "off"...
I'm trying to pass a javascript associative array to a controller.
I can pass normal arrays into a controller with this:
public JsonResult ProductsByFacets(List<string> facets)
but this won't work with associative arrays
...
Hi,
I have switched from asp.net mvc 1.0 to 2.0
My actionlinks:
<%=Html.ActionLink("Add bla", "addbla", new { id = Model.Id })%>
now produce urls like this:
addbla/500
rather than:
addbla/?Id=5008
does this have to do with the routing:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}...
I am using ASP.NET MVC 2 & C#.
I want to include/embed an html page (raw text & styling; no forms) in one of my views as is without my own css styling (read: The site.css styles for the ASP.NET MVC 2 application itself) affecting it. I can access the page statically and open it in a new window and it retains it's styling; however, if I ...
I'm pulling data from MongoDB in C# Asp.net MVC2. Here is the code I'm using in the controller.
var mongo = new Mongo();
mongo.Connect();
var db = mongo.GetDatabase("DDL");
var Provinces = db.GetCollection("Provinces");
var documents = Provinces.FindAll().Documents;
ViewData["Document"] = documents;
return View();
Now I'm unsure ho...
I have just started looking into .net MVC and I really like it.
There are a few developers within our team who think the same. But before we are alowed to use it for any project we need to get the approval of management.
What would be the best way to convince management(which know little about programming) that this would worth while an...
Hi,
This is my application's current workflow for user registration.
register form ( GET /register )
submit the form ( POST /register )
after success, redirect route to "/registerSuccess"
in (GET /registerSuccess ) view, I want to show the message like "username has been registered successfully".
Controller Actions:
public Action...
[MetadataType(typeof(PersonMetaData))]
public partial class Person {
public class PersonMetaData {
[Required(ErrorMessage="The number is required")]
public object Number {get;set;}
}
}
This error message is shown when the number field is empty and when there's an invalid input it gives "The value 'foo' is not va...