asp.net-mvc

ASP.NET MVC: How do I pass a list (from a class in Model) to a repeater in a View?

How do I do the above? I've started using MVC and I'm having issues passing data around. My specific problem is to do with a list of objects I have in my Model which I need to access in a View and iterate through. Thanks in advance. ...

Controller's actions names localization

Hello, I am facing a problem. I would like to localize my action names in my project so french people can have clean urls with french names. http://www.test.com/Home should be http://www.test.com/Accueil It is a good thing too for google indexing. Moreover I would like to be Restful on the application, so I would like too keep english...

What's the best way to expose multiple objects to a view in ASP.NET MVC?

I'm kind of new to ASP.NET MVC and to the MVC pattern in general but I'm really digging the concept and the rapidity with which I can compose an app. One thing that I'm struggling with is how to expose more than one object to a view. I use a lot of strongly typed views, which works well but what if my view relies on more than one objec...

ASP.NET MVC passing an ID in an ActionLink to the controller

Hi, I can't see to retrieve an ID I'm sending in a html.ActionLink in my controller, here is what I'm trying to do <li> <%= Html.ActionLink("Modify Villa", "Modify", "Villa", new { @id = "1" })%></li> public ActionResult Modify(string ID) { ViewData["Title"] =ID; return View(); } That's what a tutori...

RouteValueDictionary overridden by context

If you have a route: routes.MapRoute("search", "{controller}/{action}/{filter1}/{filter2}/{filter3}", _ New With {.filter1 = "", .filter2 = "", .filter3 = ""}) then in a view satisfied by the route pattern with a url of /member/search/dev/phil/hoy, when you attempt to create another route url with only filter1 present i.e. <%=Url.R...

Default route for all extreme situations

Hi! In my routing I would like to have something like not found route handler. For example I have created one mapping like routes.MapRoute( "default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id="" } ); routes.MapRoute( ...

ASP.NET MVC Form Post

<form action="/Villa/Add" method="post"> <table> <tr> <td> Name: </td> <td> <%= Html.TextBox("name") %> <%= Html.ValidationMessage("Name") %> </td> </tr> <tr> <td> </td> ...

ASP.NET MVC Relative Paths

In my applications, I often have to use relative paths. For example, when I reference JQuery, I usually do so like this: <script type="text/javascript" src="../Scripts/jquery-1.2.6.js"></script> Now that I'm making the transition to MVC, I need to account for the different paths a page might have, relative to the root. This was of cou...

New to MVC | Data in a view from different sources

OK, So i have been watching some MVC vids and reading some bits. I am new to the entire MVC pattern, and until now have been happily wrapped up in the web forms world! Like with so many demos it all seems great and I'm sure I'll have lots I dont understand as I move along, but in the first instance... I can see that you can have a stro...

Jquery Rest communication with WCF 3.5

I'm testing the basics for exchanging rest messages between a asp.net mvc site and a WCF 3.5 service. The service is built using the template found in the WCF REST Starter Kit found on codeplex. I would like to exchange json messages using jquery. The REST Singleton service is working properly and it also provide examples of all the poss...

ASP.NET MVC return a different view.

I have a view which contains a form, the form posts and the data gets processed etc, then I want to return the view Index, so return view("Index"); however this will then complain about my ViewData not existing, I get the feeling that the controller code under Index() isn't being processed which adds the list it requires to the ViewData...

Determining the results count of ViewData

Hi I have a view with several User Controls and I pass ViewData to all of them, I would like to know how you would determine the element count by specifying the string key. I understand that you cannot use comparison to an integer because ViewData is an object but I have it setup this way for explaining my question. I have also tried nul...

Should I use HtmlHelper or roll my own controls?

I'm just beginning to learn ASP.NET MVC and I've run into a question. I'm trying to determine whether I should use HtmlHelper to create client controls or if I should just roll my own. My gut wants to lean towards just rolling my own because it gives me total control - and use jQuery to decorate and add cross-browswer functionality. Bu...

Server Controls and MVC

I've been lead to believe, without research, that server controls are forfeited in the MVC model. I am both very curious to know if this is true, and if so, how would one achieve something equivalent to a Repeater control, or any other view whose exact structure depends on the content of the model? ...

MVC route localization

While playing around with localization using Matt Hawley's approach. I wonder if someone has figured to localize routes. I can do this using global resources per site. But when I would try to make it a users choice (so users can switch between languages) the architecture does not allow it because the routes are mapped at application star...

ASP.NET MVC Authenticate

is it possible to create something like this i ASP.NET MVC beta 1 i have tried but the override bool OnPreAction(string actionName, System.Reflection.MethodInfo methodInfo) does not exsist anymore and override void OnActionExecuting(ActionExecutingContext filterContext) don't give me access to the act...

Automatically setting up unit test projects in VS2008, need help

I'm beginning to toy with the new ASP.NET MVC framework, and reading around in some tutorials I saw that in addition to creating the MVC project, theres an option to add a Unit Test project, using the Test framework (which I have) thats basically already set up for MVC testing. Its supposed to pop up when you create a new MVC project, an...

ASP.NET-MVC (IIS6) Error on high traffic: Specified cast is not valid

...

.Net MVC Routing Catchall not working

I can't seem to figure this out. I'm experimenting with MVC Beta and am trying to implement a catchall route such that if the user enters mysite.com/blah instead of mysite.com/home/index it will hit the "Error" route. Unfortunately it seems that the "Default" route always catches "blah" first. In fact the only route I've been able to g...

Html.ActionLink doesn't render # properly

When using Html.ActionLink passing a string containing the # char renders it like it is but if you UrlEncode it renders as %2523. I believe it's a bug. MVC Beta Release. Is it really a bug? http://example.com/test# is rendered as http://example.com/test%2523 instead of http://example.com/test%2523 ...