asp.net-mvc

ASP.NET MVC AJAX Problem

So I have a simple voting feature on my asp.net mvc page. My index page is loaded with all the posts in the database. A user can vote yes or no as to whether they liked the post or not via links within each post. So in my database I have a table called posts and there are two fields in that table named vote_yes and vote_no that track ...

ASP.NET MVC with tree - pattern

Hello, I am preparing a skeleton of ASP.NET MVC application with basic CRUD functions on Products and Parts included in these products. Application contains couple of strongly-typed views based on the MasterPage and now I want to add a widget to display the menu tree. This menu tree is going to reflect the Products/Parts structure so it ...

Check if the user changed data

When a user registers at our site we check the address with an address validation service. This service can return an address suggestion if the entered address is found but has some errors. This sugggestion is returned to the user. The user can accept the suggestion and is trusted. If he changes the address he is not trusted. Is there ...

ASP.Net MVC - Compiler Errors in Views

I wonder if anyone can explain why Visual Studio does not report compile errors on the View Pages? I ask because I noticed that Re-Sharper (At least i think it is) picks up the fact that I have included a dead referance in my view but the project will build. eg, <%@ Import Namespace="Site.This.Is.Dead.Link"%> Its only when navigati...

Move from Dev Server to Prod Server - The incoming request does not match any route

I have developed an app on a dev machine using ASP.Net MVC and all is fine and it works. I have moved it to the Prod Server and when I type http://mydomain.com I get the error: The incoming request does not match any route If I then make a request to http://mydomain.com/pagename I then get a IIS 7 404 page. It is hosted in a Full Trus...

Can I access my controller/action/verb from my derived AuthorizeAttribute?

As a theoretical exercise to help me learn the ins and outs of the membership model with relation to MVC I want to figure out if I can load permissions from an external resource, for the purpose of my prototype I've got a flat file that has a list like so: Controller1,Method1,Get,Anonymous Controller1,Method1,Post,User,Administrator Con...

asp.net mvc: how to create custom binding for models when using LINQ to Entities

I've got a number of tables in my db that share common cols: modified by, modified date, etc. Not every table has these cols. We're using LINQ to Enties to generate the I'd like to create a custom binder class that can handle the automatic binding of these fields. Is there a way to do this without having a custom binding class for e...

Is it ok to use ASP.NET MVC on production?

Since ASP.NET MVC is still in beta, is it OK to use it in a production environment? It's gotta be OK since StackOverflow and many other sites use it, right? I've been wanting to try it out, but I know if I propose actually using it on production I will get resistance because it's still in beta. ...

In ASP.NET MVC how do you run JavaScript after a form POST is returned?

How do you run JavaScript after a Form has been successfully posted and returned? <% Html.BeginForm(); %> .... <% Html.EndForm(); %> ...

What's wrong with my AutoMapper Customer ValueResolver Hook?

I have the following hook in my Global.aspx protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); AutoMapper.Mapper.CreateMap<FormCollection, Models.IAmACustomer>().ForAllMembers(form => form.ResolveUsing<Models.FormCollectionValueResolver<Models.IAmACustomer>>()); } In ...

Is IDataErrorInfo ignored during model validation in MVC 2?

I currently migrated my project to MVC 2 and IDataErrorInfo doesn't seem to work when using default model binding and validation. Is it cut out? ...

Where should you unit test your validation?

Hi This is bothering me for some time now. I put all my validation in a service layer. However when I unit test I usually pass everything through action method. Then that goes into my service layer what contains the validation. So I am not sure now if that is the best way to do it. Since usually they say you should just test that metho...

Generate PDF files from asp.net mvc

I'd like to print receipts from my asp.net mvc app. For now I think my best option is to create PDF files, which are easier to handle when they are going to print them, because of the margins/headers/footers/etc. I don't want to have them configure their browsers just so they can print my receipts, some of them are just not that smart. ...

ASP.NET MVC got 405 error on HTTP DELETE request?

I'm trying to pass the DELETE to a URL in asp.net MVC using JavaScript but however i always got 405 Method not allow return. is there anyway to make this work? FYI: I've put the [AcceptVerb(HttpVerb.Delete)] attribute on my controller. DELETE /post/delete/8 this is the request ...

ASP.NET MVC 2 Beta - Default Model Binder

I'm experiencing some different behavior after switching from ASP.NET MVC 1.0 to ASP.NET MVC 2 Beta. I checked the breaking changes but it's not clear where the issue lies. The problem has to do with the default model binder and a model that implements IDataErrorInfo. The property (IDataErrorInfo.Item): public string this[string colum...

controller member

In my mvc application, i'm having a controller where many actions are their. I'm having a property for the controller class. In index controller i'm setting the value for the property , will it able to get same value in another action.. public class HomeController : BaseController { int sample =0; public ActionResult Index(int ...

Why is http-response in chunked transfer-encoding only for some clients

Hi! I have an asp.net mvc application running on IIS 7. The problem I'm having is that depending on client the response may be recived (as seen through fiddler) as "chunked transfer-encoding. What I can't understand is why this only happens to some of my clients (even if two computers is on the same network with the same browser (IE 8) ...

Please help me with ASP.NET MVC Paging error

hello all, I am getting the following error in my mvc application when I am doing the paging functionality CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'HasPreviousPage' and no extension method 'HasPreviousPage' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be fo...

textbox to rtl inmvc

in my mvc application i'm having a textbox. Where this application is for libya so i have det the textbox direction to "RTL" The textbox focus moved teh right, but when typing the each char get append in side of LTR only.. I need when we type it gets append to RTL. ...

ASP.Net MVC Go To Declaration On view

Is there anyway when in an MVC view to right click a function call and get to the declaration? Like you can do in the code behind/controllers ...