asp.net-mvc

What Do the New Features of C#4 Offer ASP.NET MVC Developers?

Is there any particular aspect of C#4 that I could find beneficial in learning in the context of an ASP.NET MVC application? Thanks ...

Compilation error "Could not load type 'System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>'" in web deploy project. Asp.net mvc rc2

i'm getting the below error, When compiling the Asp.Net web deploy project Could not load type 'System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>'. /Shared/Error.aspx But when I compile the web project, It is not showing any error. ...

Error while installing MVC Framework

Hi, I tried to install MVC Framework from the below URL http://www.asp.net/mVC/ First it is installing web plateform installer 2.0, once it is done, it is throwing an error Asp.net mvc2(visual studio 2008 tools) requires VS2008 Sp1 Please let me know what I have to install to run MVC Below is my configration: OS: Microsoft Windows...

Really lost with OpenID and ASP.NET MVC

I'm attempting to implement OpenID with ASP.NET MVC (Yeah, we haven't heard that one before I'm sure!) That really isn't the big problem, though. My huge problem is that I am exceedingly confused about how to do this alongside an application that will need to store a lot of information about the logged in users (profiles, histories, et...

HTML Submit button vs AJAX based Post (ASP.NET MVC)

I'm after some design advice. I'm working on an application with a fellow developer. I'm from the Webforms world and he's done a lot with jQuery and AJAX stuff. We're collaborating on a new ASP.MVC 1.0 app. He's done some pretty amazing stuff that I'm just getting my head around, and used some 3rd party tools etc. for datagrids etc. ...

Facebook Card Game? Which architecture?

I am developing a Facebook Card Game for my thesis and i am wondering which architecture fits best? I am going to develop the game using Silverlight + ASP.NET. On the one side the game should contain player vs. player card games. On the other there will be also a lot of contant similar to Mafia Wars(or any other game like that) where...

What's the best way to develop a debugging window for an ajax ASP.Net MVC application

While developing my ASP.NET MVC, I have started to see the need for a debugging console window to assist in figuring out what is going right and wrong in my code. I read the last few chapters of the Pro Asp.net MVC book, and the author details how to use http modules to show page load/creation times and linq to sql query logs, both of w...

How to set xmlns when serializing object in c#

I am serializing an object in my ASP.net MVC program to an xml string like this; StringWriter sw = new StringWriter(); XmlSerializer s = new XmlSerializer(typeof(mytype)); s.Serialize(sw, myData); Now this give me this as the first 2 lines; <?xml version="1.0" encoding="utf-16"?> <GetCustomerName xmlns:xsi="http://www.w3.org/2001/XML...

How to structure an enterprise MVC app, and where does Business Logic go?

I am an MVC newbie. As far as I can tell: Controller: deals with routing requests View: deals with presentation of data Model: looks a whole lot like a Data Access layer Where does the Business Logic go? Take a large enterprise application with: Several different sources of data (WCF, WebServices and ADO) tied together in a dat...

Why have or haven't you moved to ASP.NET MVC yet?

I find myself on the edge of trying out ASP.NET MVC but there is still "something" holding me back. Are you still waiting to try it, and if so, why? If you finally decided to use it, what helped you get over your hesitation? I'm not worried about it from a technical point of view; I know the pros and cons of web forms vs ASP.NET MVC. My...

ASP.NET MVC 2 Localization/Globalization stored in the database?

Hello I've been searching for a while for a good example of localizing an C# ASP.NET MVC 2 application but storing the data in the database instead of .RESX files. Unfortunately I've had no luck finding a good example and was hoping someone else may know and could point me in the right direction? Many thanks for any help/advice/articl...

ASP.NET MVC Route Contraints with {ID}-{Slug} Format

I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page routes.MapRoute( "Layout", // Route name "layout/{id}-{slug}", // URL with parameters new ...

How to get Screen Shot / Screen Capture from Web user on MVC site?

I've seen a few different apps that allow users to take screen shots on their PC and then the utility will automatically upload the image to the web server. I'd like to incorporate this type of functionality into a new MVC site. I could certainly just allow the user to upload their own image, but it'd be cleaner if they could click Cap...

asp.net mvc2 - controller for master page and code organization

I've just finished my first ASP.NET MVC (2) CMS. Next step is to build website that will show data from CMS's database. This is website design: #1 (Red box) - displays article categories. ViewModel: public class CategoriesDisplay { public CategoriesDisplay() { } public int CategoryID { set; get; } public...

Is it weird or strange to make multiple WCF Calls to build a ViewModel before presenting it?

Am I doing something wrong if I need code like this in a Controller? Should I be doing something differently? public ActionResult Details(int id) { var svc = new ServiceClient(); var model = new MyViewModel(); model.ObjectA = svc.GetObjectA(id); model.ObjectB = svc.GetObjectB(id); model.ObjectC = svc.GetObjectC(id); ...

Html.Encode question

I'm working through the NerdDinner MVC tutorial and came across this and was wondering about. On page 62 of the pdf they have the following: <asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server"> <h2>Upcoming Dinners</h2> <ul> <% foreach (var dinner in Model) { %> <li> <a h...

Creating LINQ to SQL Data Models' Data Contexts with ASP.NET MVC

I'm just getting started with ASP.NET MVC, mostly by reading ScottGu's tutorial. To create my database connections, I followed the steps he outlined, which were to create a LINQ-to-SQL dbml model, add in the database tables through the Server Explorer, and finally to create a DataContext class. That last part is the part I'm stuck on. I...

Page Redirect when session end in ASP.Net MVC

I would like to do redirect to login when current session end and that config must be working at any View and Controller. ///My current code in Global.asax protected void Session_End(object sender, EventArgs e) { Session.Abandon(); //GetPath() is getting currently path // eg. http://localhost/mymvcproject Response.R...

What is the use case of the generic ViewMasterPage<T>?

In ASP.NET MVC there are generic master views (ViewMaserPage<T>). But what is the purpose of them? As I see it, generic argument of master view and "slave" view must be equal and this constraints me to using the same model for all my views. ...

How to post back selected checkboxes to Controller

I have following view <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Tables <%=ViewData["RetriverName"] %></h2> <%using (Html.BeginForm("ResfreshSelectedTables", "Home")) { // begin form%> <table id="MyTable"> <thread> <tr> <th style="width: 150px; text-align:center"><in...