asp.net-mvc

How malleable are the conventions in ASP.NET MVC?

Specifically, does a controller class name have to have the Controller suffix, and can you change the folder structure in your project if you want to, without breaking things? Are there other conventions that can be overridden, and how? ...

How do I prevent ASP.NET MVC from caching invalid data in my View?

I have a situation that I can't seem to find any help on. I looked through many questions on here, but can't seem to find anybody that has asked (or answered) my specific question. Here it is: Assume I have 2 categories: Paper (id: 1) Plastic (id: 2) The user clicks on Paper, change the name to Plastic, and click 'Submit'. Inside m...

How to implement tag counting

I have my tags desinged like this in my database: Table: Item Columns: ItemID, Title, Content Table: Tag Columns: TagID, Title Table: ItemTag Columns: ItemID, TagID //example -- this is the right sidebar of stackoverflow c# × 59279 sql × 14885 asp.net-mvc × 9123 linq × 4337 tags × 339 if I wanted to know the count of each ta...

mvc: How do I add a initial Item to a DropDownList with Key of 0 and Description of 'Show All'

Here is an extract of my FormViewModel : public SummaryFormViewModel(IEnumerable<Site> sites, IEnumerable<Landowner> landowners) { var sitesValues = sites .OrderBy(s => s.SiteDescription) .Select(s => new KeyValuePair<int, string>(s.SiteId, s.SiteDescription)); this.Sites = new SelectList...

Is ASP.NET MVC a good platform?

I aim to try use DevExpress web server controls (which are awesome) in an ASP.NET MVC project (some articles I read on 'net seems to indicate the two can work well together). I'm eager to start a new project using ASP.NET MVC, and I have been reading up a lot on ASP.NET MVC lately, but I'm not sure if I should invest a project in it. My...

MVCSitemap - maintaining the ID parameter in sub-pages

I've got the following structure to a site: /Products/ /Details/{ID} /Details/Edit/{ID} It's slightly different from the usual /products/edit and /products/details approach most sites have, because the edit link is only available on the Details page. My problem is ASP.NET MVCSitemap doesn't maintain the keys in the sitema...

Where have the Mvc Code behind files gone ?

In my MVC 2 (RC) I do not see the Codebehind files, Have they been deliberately remvoed ? ...

Trying to upload a file with ASP.NET MVC Error invalid character in a base-64 string

Try to upload file using asp.net mvc error occured "invalid character in a base-64 string". ...

Serving HTML or ASPX files with ASP.NET MVC

I want to implemented URL like : www.domain.com/Business/Manufacturing/Category/Product1 This will give the details of specific product(such as specifications). Since the list of Categories & Products in each Category are limited, I thought it is not worth to use database for products. So I want to implement it using the HTML or ASP...

How to configure asp.net MVC project in IIS?

When I run project in IIS, after displaying home page it will not allow to redirect on any other page. It gives Page could not found error. ...

Flash movie not made available by ASP.NET MVC

I'm working on an ASP.NET MVC app that uses a Flash movie as a banner. I'm trying to load it, however for some reason the url gets treated as an Action and the user is redirected to the login page. The funny thing is, if I put a file in the same directory with a different extension (.txt, for example) and try to load that, it doesn't ge...

Using SimpleModal and ASP.NET MVC

Hi - I am using Simple Modal with asp.net MVC. I have set it up using the OSX demo, which loads a view into the dialog. The javascript I am using is: jQuery(function($) { $("input.ema, a.ema").click(function(e) { e.preventDefault(); $("#osx-modal-content").modal({ appendTo: 'form', overlayId:...

Inline Template, Assign HTML as string to model Property.

Hi, is there a way in ASP.NET MVC(2) to do something like that: <table> <tr> <% Model.Pager.TemplateNextPage = { %> <li><a href={link-next-page}>Next</a></li> <% } %> <% Model.Pager.TemplatePageNumber = { %> <li><a href={link-page-number}>{number}</a></li> <% } %> <%...

usefulness of microsoft data access application

Hi all, I am planning to start learning asp.net mvc. And also I want to learn Microsoft's Data Access application block. But I dont want to waste time in MDAC block if theres a better option to go for, or if MVC provides any good feature than MDAC. As I have heard MVC architecture automatically generates code. So, please guide me regardi...

ASP.NET MVC URl Routing: How to deal with ?Action=Test parameter

I am required to implement a simple webapp for a online competition for a simple game. I need to handle a Get request and respond to that. I thought, let's just use a bare ASP.Net MVC app, and let it handle the URL. Problem is, the URL I need to handle is : http://myDomain.com/bot/?Action=DoThis&amp;Foo=Bar I tried: public Action...

How to handle time difference in ASP.Net (MVC)?

Hey! I've published a web application to a server in the USA. The app is actually for swedes (people in Sweden) and I am looking for the best way to hadle the time difference. There's a +7 hour difference. Should I store the DateTime.Now in DB as it is, or should I use DateDiff to change the time before creating each record? What's t...

Run an action on link click, jQuery

I have a series of images, and I simply want to record when each is clicked. They never show up in their own view, so running the code there is worthless. I've wired up a click event using jQuery. Though the $.post doesn't work. Any idea how I can achieve what I am trying? The 'hit' is just an HTML element stored in the view when it dra...

ASP.NET MVC Session State

Is there any way to tell if a visitor to a site is new, or just the same one over and over again, for the purpose of a hit counter? Sessions don't really seem to exist in MVC, so I know I can't really use them... ...

Asp.net MVC 2: Can Ajax.ActionLink pass a parameter without it going into the url?

I have the following in partial view <%= Ajax.ActionLink("Plunder Again", "Resources", new { controller = "Resource", parent = Model.ToJson() }, new AjaxOptions { UpdateTargetId = Model.ResourceType })%> going to the controller method: public ViewResult Resources(/*ModelResource parent*/) { Debug.Assert(Request.Params...

ASP.NET MVC View Model with LINQ To Entities

Let's say I create a query result var query = from a in tblXYZ join c in tblABC on a.id = b.id select new {a.x, b.x}; What's the best way to pass that into a view? Should I create a new object and copy the query result into it? ...