mvc

Question about Html.Routelink output - ASP.NET C# MVC

Hi, I have a call that looks like this: <%= Html.RouteLink(item.displayName, "DisplayCategory", new { category = Html.Encode(item.displayName), subcat = item.searchName }) %> and I'm getting html that looks like this: http://localhost:1485/Home/ShowCategory/Electronics%20&amp;%20Photography?subcat=electronics-photo Why does the UR...

Controller logic and template logic, where do you draw the line with pagination?

The whole point of an MVC framework is to separate design (templates) from logic (controllers). However, template languages often afford a limited degree of "design logic" to occur. This includes basic if statements, loops, filtering, etc. I've created a Django template tag that can take any list or QuerySet and "pagify" it. It split...

Starting with / converting to ASP.NET MVC

I don't know much about MVC, but I have a project where I think I could use a lot of the functionality of ASP.NET MVC based KIGG. At the same time I have a HTML/jQuery based template. How should I approach this? What I am kind of hoping is that I can easily pick Views with behindlaying objects from KIGG, and then easily modify it. Is...

Building a CMS in ASP.NET MVC

I'm curious to know if any basic CMS code has been written for ASP.NET MVC. The reason I ask is, I'm making a data-driven website for a client, and I've already spent a significant amount of time building it from the ground-up in MVC, but now the client wants content management facilities. Basically they want to be able to add/edit/rem...

JS Framework incorporated with CruiseControl

Are there any JS Framework that can be incorporated with CruiseControl.NET ? Or what's the best JS Framework that have an intensive unit testing feature. ...

ViewModel Best Practices

From this question, it looks like it makes sense to have a controller create a ViewModel that more accurately reflects the model that the view is trying to display, but I'm curious about some of the conventions (I'm new to the MVC pattern, if it wasn't already obvious). Basically, I had the following questions: I normally like to have...

Any slick and clever ways to inject JQuery before the page begins rendering?

I'm looking to somehow get jQuery inserted into every page with the MINIMUM of code written... in other words I don't want to write <script language="javascript" src="PATH TO JQUERY"></script> on every single aspx page. So far I've thought of using a Base class and inserting a "Response.Write" into the "page load" event. Besides that, w...

Possible to port legacy servlet to framework one component at a time?

Hello all, I have heard that you can run an ASP.NET application and ASP.NET mvc application side by side so that you can port existing code over one piece at a time. I was wondering if you could do this with a java framework? I have a legacy servlet application that I am currently in the process of refactoring. I am thinking about turn...

ASP.NET MVC Readonly Field Based on Action in Partial View

When using a partial view in ASP.NET MVC to encapsulate the creating/editing markup, what is the best way to change which control gets rendered based on the action? For example, I want to only allow an email address to be entered upon account creation (via a textbox) and then viewable (via plain HTML) when viewing the account. In pseud...

What is the difference between MVC and MVVM?

Is there a difference between the standard "Model View Controller" pattern and Microsoft's Model/View/ViewModel pattern? ...

MVC and Java in comparison with more strict MVC languages

I've been told Java is not the greatest pick to follow an MVC architecture. I believe I've seen some Java framework solutions to ease this roadbump. However, I a bit confused on why this is. More specifically, why Java's attempt at MVC is often mocked as a "wannabe" approach. I come from a ObjC background (w/ Cocoa of course) and would l...

ADO.NET MVC Tutorial (with LINQ to SQL) question about schema changes

So I'm working through the new scottgu wrox book, and I create a couple tables. Then (per the tutorial) I use linq to sql to build my Models, DataCOntext, Repository, etc. (It's pretty clear that LINQ to SQL seems to be "the Microsoft Way" to generate models and similar classes from schemas.) Then I find I've neglected to include one of...

Recommended data structure/format for web MVC applications?

What's a good data structure for use in MVC web applications to use to pass data into view to ensure standardization and keep the view as non-coder friendly as possible? ...

Writing a GUI in squeak

How can I write a GIU in Squeak? I'm a Smalltalk newbie and I'm using Cincom's VisualWorks at the moment but I'd like to give Squeak a try. I see that Squeak has Morphic for graphics but for the life of me I can't seem to find a package to write an MVC based GUI. ...

MVC - Passing Data with RedirectToAction()

What I'm attempting to do is take the data entered into an MVC user form and submit it back to the user in a different view. I have a private variabled declared in the class: IList<string> _pagecontent = new List<string>(); Here is my action that accepts the FormCollection object, validates it, and tries to pass it on to the "Previ...

AssemblyInfo versioning ignored in ASP.NET MVC Web App?

Strange one here. My MVC Web Application's version number is not printing correctly to my view according to what is set in AssemblyInfo.cs. The definition I have set in set AssemblyInfo.cs is '1.0.232.0'. I have tried multiple methods in order to print it: <%= System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToStri...

Dependency Injection and C# syntax

I wonder if anyone can explain the syntax in one line of this snippet of code: public class ContactController : Controller { private IContactManagerRepository _repository; **public ContactController() : this(new EntityContactManagerRepository())** {} public ContactController(IContactManagerRepository reposito...

How to catch an exception thrown by a filter in .NET's MVC?

One of the filters on an application I'm developing checks to see if a user owns the item they are trying to alter. The action is decorated by the [RequiresOwnership] attribute, and inside the attribute logic, I check to see if the user owns the item, and if they don't, I throw an UnauthorizedAccessException. My question is this: Where ...

whats the best asp.net mvc tutorial(s) out there? <EOM>

answer could include blogs, podcast, etc ...

Read htmlAttribute in controller

I have Ajax.ActionLink with htmlAttribute param <%= Ajax.ActionLink("cool", "ViewCategory", new { id = elem.ID }, new AjaxOptions { UpdateTargetId = "score_" + elem.ID.ToString() }, new { myAttr = 123 } )%> How can I read this attribute in controller method? ...