asp.net-mvc

"The resource cannot be found." error when there is a "dot" at the end of the url

Hi, I'm using ASP .NET MVC Beta and I get the HTTP 404 (The resource cannot be found) error when I use this url which has a "dot" at the end: http://localhost:81/Title/Edit/Code1. If I remove the dot at the end or the dot is somewhere in the middle I don't get the error. I tried to debug but it I get the error from "System.Web.Cached...

MVC Repository Pattern: Creating Model Classes

Reviewing Conery's storefront, and I dont understand why he used Linqs auto-generated classes (ie Order class) and then he has another Order class defined that is not a partial class. WHen using repository pattern should one manually create the classes, and disregard Datacontext altogether? ...

Why is User (as in User.Identity.Name) null in my abstract base controller?

Hello Folks, I was asking a related question but messed the title up and no-one would understand it. Since I am able now to ask the question more precisely, I decided to reformulate it in a new question and close the old one. Sorry for that. So what I want to do is passing data (my custom user's nickname as stored in the db) to the Log...

How to deploy web app directly from Visual Studio 2008?

I used to use discountasp.net and I can use Visual Studio 2008 to "publish" the website directly to the web host. I am using a dedicated server now (well, to be exact, Amazon EC2 Windows), how should I setup the web server so I can deploy the website directly from VS 2008? I tried to setup a FTP server but couldn't get it working. Thank...

asp.net mvc routing problem when passed parameter contains dot

Hi, I have very basic routing: routes.MapRoute( "Default", "{controller}/{action}/{id}",parameters new { controller = "Home", action = "Index", id = "" } ); The problem is that it works perfectly in all simple cases, like "www.xxx.yy/pages/filter/test". As soon as I add dot "."...

How do I configure ASP.net MVC to Scaffold using ADO.net dataservice??

Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work out of the box is extremely easy. What tweaks would you make to make it work with ADO.net Data Services? ...

Should I return IList or List to the Controller in MVC ?

What is difference to the controller that gets the return with repect to rendering the List? In Linq dataContext: public IList<Response> GetResponses(int ID) { var responses = from r in this.Responses where r.ID == ID orderby r.Date select r; return responses.ToList(); } OR public List<Response> GetResponse...

When are ASP.NET MVC Controllers garbage collected?

Once a controller object is created when does it become available for garbage collection? ...

Should I use the membership provider when using MVC and a forum database?

I want to use an existing user and user group table that the forums use. I would prefer not to have to add any additional tables (other than what the forum already has). I will be using MS SQL. The forums are PHP which is why I want the .net site to handle all of the logic. The forum will use its own PHP logic as I will set and remove ...

How to I find the absolute url of an action in ASP.NET MVC?

I need to do something like this: <script type="text/javascript"> token_url = "http://example.com/your_token_url"; </script> I'm using the Beta version of MVC, but I can't figure out how to get the absolute url of an action. I'd like to do something like this: <%= Url.AbsoluteAction("Action","Controller")) %> Is there a helper ...

How do I add first user (root) in ASP.NET MVC app?

I'm using ASP.NET MVC Framwork and trying to grok the ASP Membership 3.5 stuff. What is the best way to add the first administrator user without having to log in? I've been staring at the membership starter kit's source without finding it. ...

Passing data from View to Controller

Hello, In an ASP.NET MVC application, I'm making logic for Admin to accept or reject new members. I'm showing a list of members and two buttons Accept and Reject, like this: <% foreach (var mm in (ViewData["pendingmembers"] as List<MyMember>)) %> <% { %> <tr><td>Username:<%=mm.UserName %></td><td> <tr><td>Firstname:<%=mm.FirstNam...

CSS and Javascript relative path confusion in ASP.NET MVC

My javascript paths work on this page: http://localhost:53049/ But not on this page: http://localhost:53049/Home/Messages The reason is that the relative paths are different, the former requires ("js/...") and the latter requires ("../../js/..."). I'm including my javascript in my Site.Master file: <script type="text/javascript" src=...

ASP.NET MVC - Is it viable for small web outfits?

I work for a small website company (couple of programmers, couple of designers). Currently we use ASP.NET website projects - this makes it easy for me to sort the programming out on my local machine, while the designers work directly on a development server and the 'on-the-fly' compilation allows them to see any changes made without havi...

Can you overload controller methods in ASP.Net MVC?

Im curious to see if you can overload controller methods in ASP.Net MVC. Whenever I try, I get the error below. The two methods accept different arguements. Is this something that cannot be done? The current request for action 'MyMethod' on controller type 'MyController' is ambiguous between the following action methods: ...

What is the right pattern for using JQuery Ajax and ASP.Net Mvc?

I'm very new to both the Mvc framework as well as JavaScript and JQuery. I'm trying to understand the right way to structure Ajax calls. Let's say I have a "Vote Up" button similar to what you see on StackOverflow. When the user clicks it I need to update the vote count in the database and return the new value to the UI. Currently I am ...

How do you handle reporting filters in ASP.NET MVC?

For a given report, the user will want to have multiple filtering options. This isn't bad when the options are enumerations, and other 'static' data types, however things can get silly fast when you need a select list that is populated by fields stored in a table in the backend. How do you handle this scenario? I find myself constantl...

MVC DataContext Ok to Share One Connection or Not

When is the "unit of work" no longer a "unit"? Which scenario is better on resources? THe first creates one connection wheras the second creates 4. using (DataContext dc=new DataContext) { var orders= from o in dc.orders select ( new Product { property a= from a in ..join... select x, ...

Submitting form elements with the same name

I have a form which allows the user to create extra "rows" using JQuery (using .clone) so that they can decide how many of the same information they need to submit. My issue is that I cannot work out how to access these form items within my controller. the form that is being submitted may look like this <input type="text" name="Amount"...

In ASP.NET MVC, why do my custom JavaScript files not work in /Scripts?

I can successfully include main jquery files in /Scripts, but if my custom test.js file is in Scripts, it will not work: <script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/jquery-1.2.6.js") %>"></script> <script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/test.js") %>"></script> However, wh...