asp.net-mvc

How to write unit test for ASP.NET MVC using VB.NET

Hi, Can you help with the problem which i'm currently facing? We've created ASP.NET MVC application with "Out Proc" seesion state managment. We are using strong type session in our control class. Here sample code FYR.. Public Class CustomerController Inherits TxnProcess TxnProcess -- this class extended by another class which is...

asp.net mvc - how do i reference an asp file inside the View Directory

i have a page inside my asp..net mvc site. (for some reason it has to be in this directory) Views/Members/Calendar/admin.asp i tried going to: http://www.mySite.com/Views/Members/Calendar/admin.asp but this doesn't seem to work. any suggestions on how to have a link to this page? ...

Web App architecture questions

Background: I am an intermediate web app developer working on the .Net Platform. Most of my work has been defined pretty well for me by my peers or superiors and I have no problem following instructions and getting the job done. The task at hand: I was recently asked by an old friend to redo his web app from scratch. His app is extreme...

ASP.NET MVC Url.Action routing error

Hi, I've been using this some while now, but I can't seem to figure out, where could be mistake in this simple code: <a href="<%= Url.Action("Page", new { page=(Model.PageIndex + 1) }) %>" >a</a> With this routing table: routes.MapRoute( "Paging", "Home/Page/{page}", new { controller = "Home", acti...

ASP.NET MVC Deployment Problem

I have deployed my application to a server running IIS6 using the method which invloves changing the routes to: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route n...

subsonic 3 and active record replacing single quotes in data

hi i am using subsonic 3 and activerecord it is my first time with this and i was just wondering if anyone can point me to some reading material with regards to inserting records. the examples i can find for adding and editing only seem to add and update the data, but i want to check the data first and replace any single quotes with dou...

LINQ Modelling Automagically Retrieving Data Via EntityRef

I'm using LINQ to model my database, but I'm writing it by hand (Steve Sanderson recommends this in his ASP.NET MVC book). What I need to know is what's happening when you create an EntityRef, and how it's referenced. If I create my queries manually (without using LINQ), but use LINQ to model it, and I bring back just the ID of somethi...

Visual Studio/ASP.NET MVC Project Organization & Structure Links, Examples and Personal Preferences

Hello, I'm looking for multiple inputs on great project organization/structure, preferably especially for complex ASP.NET MVC projects (which will definitely go beyond the couple of folders initially created by the project type). Project organization also includes topics like naming conventions, lumper/splitter preference on classes, ...

Use MVC Custom Model Binder?

I have an MVC app I'm writing. There will be the need for multiple instances of the same page to be open, each accessing different records from a database, these record objects will also need to be passed through a flow of pages, before finally being updated. What's the best, and most correct, way of acheiving this - should/can I creat...

Selected Item doesnt get selected

Hello I have a problem with a selectlist, I have 8 items and 3 of them gets the value selected = true in debug, but the rendered Html the item isnt selected. What might be wrong? List<SelectListItem> UsergroupID = (from usg in _ug.GetUsergroups().ToList() join ug in u.Usergroups ...

Are there add-on libraries or tools available for ASP.NET MVC development?

My first experience with ASP.NET MVC and the Entity Framework has raised my interest in this framework and I would like to implement some basic applications, covering the basic requirements of real-world web applications. So far the support given by VS 2008 is already impressive. For some areas however, it might be a time saver to use ex...

How can I extend the Model in ASP.NET MVC and Entity Framework?

In my first ASP.NET MVC applications, the model was a simple O/R mapping between a table and the classes, managed by the Entity Framework. Now I would like to add some meat to this skeleton, and introduce business methods for the generated classes. What is the recommended approch to this in ASP.NET MVC (with Entity Framework)? My favori...

Linq mapping to multiple tables

I working my way through the Apress "Pro ASP.NET MVC Framework" ( http://www.apress.com/book/view/9781430210078 ) book, and in an example the author creates a link to a db table (as well as a fake repository) using linq like this:- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Li...

ASP MVC.NET - how to bind KeyValuePair?

Is it possible to bind such kind of property? public KeyValuePair<string, string> Stuff { get; set; } I've tried to use following code in the view, but it does not work: <%=Html.Text("Stuff", Model.Stuff.Value)%> <%=Html.Hidden("Model.Stuff.Key", Model.Stuff.Key)%> ...

Tempdata in ASP.Net MVC with JSON Request

Hi, I have an ActionResult that sets TempData to be an object. The page that is rendered contains a button, that launches a JSON request to the same controller. (For jqGrid population). The TempData on the JSON Request is null - why does this happen? Even more bizarrely, if I had a button that posts to the same controller, and I cli...

Pros and cons for different lambda expression syntax in view helper call

I'm writing a view helper based on the ideas about partial requests from this blog post: http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/ In the controller action I prepare a widget by running: AddWidget<Someontroller>(x => x.OtherActionName(new List<int>())); Then in my view I can run the action and render the vi...

Is Rapid Development a moot point in ASP.NET MVC?

Since asp.net mvc did away with many controls that were in webforms, does this make rapid application development equal with other environments now? For example, if I have an mvc framework in php, j2ee, etc., and I have asp.net mvc, and the coder knows the given platform, isn't the development advantage gone in visual studio? If I am...

Using a GUID as the ID in a database with ASP.NET MVC

Hello SO: I am learning ASP.NET MVC. I am following one of the basic tutorials on asp.net. Since I do not always follow the tutorials to the letter, I decided to use a GUID as the identity column instead of an integer. Everything was working fine until I got up to the point of adding a new record to the database through the MVC applicat...

Does Linq to Sql have onChanging?

Hi I am looking at this tutorial yet it uses the entity framework. so I am wondering can I do the same thing with linq to sql and if so how? They seem to use this OnChaning thing but I don't know if linq to sql has it. ...

How to submit with jQuery dialog using buttons with different values

I'd like to use jQuery's dialog to replace some code I'm using right now within an ASP.NET MVC application. The old code used 'submit' buttons with different 'value' settings. I'd like to know also if there is a better approach. This is an example of the existing code within the view: <%using (Html.BeginForm("SubmitValue", ...