asp.net-mvc

why MVC instead of good old asp.net? Still not grasping why I should go this route??

I know this question has been asked before and I read all the answers but they still don't give me the answers I am looking for. I need something concrete. I volunteered to give a presentation on MVC to other developers in our group which forces me to learn it. The big question everyone has is: "What can MVC bring to the table that we...

How to call the previous querystring parameter in .aspx

Let's say I have a ActionResult method that has a pageNumber parameter and a category parameter. The user should be able to set the category he's browsing which would be a ActionLink to the first page of that category. However if I have an another ActionLink where I go to the next page the category parameter would go back to default. H...

NerdDinner Visual Web Developer 2010 Settings

I'm following steps of the NerdDinner tutorial. In the dinner Model class where I have error and validation handling for CRUD instead of error notifications in browser I get some kind of debugger dialog. Why is that? ...

Asp.Net MVC Routing - Trying avoid using the same controller in different places and think routing may be an option here.

I'm currently building a site which has a bunch of main categories and in each category you can perform a search. Basically, I want my addresses to work like this... When the website loads (as in when someone goes to www.mySite.com) it will redirect them to the default category. www.mySite.com/Category Then when you search within a c...

All Silverlight Examples use WebForms. Are there tutorials for use with MVC 2?

I'd like to see if anyone out there can steer me in the right direction for linking up a Silverlight project with an MVC2 one. I know how to get it started but how do I get the .xap to show in the View? Looking for a good tutorial or blog? ...

asp.net viewdata

public ActionResult AddDinner() { Dinner dinner = dinnerRepository.GetDinner(id); ViewData["dinner"] = repository.AllDinners(); return View(dinner); } 1) First, are both the dinner object and the ViewData["dinner"] is passing to the view? 2) Second, how would I iterate over the ViewData["dinner"] in the view? ...

Load Balancer and Port Headers ASP.NET MVC

Hi Guys, I think I am having Same-Origin problems with javascript being served and I think the problem relates to load balancer. Here are some of the headers I am getting for some javascript Host , value: www.host.com Referer , value: http://www.referrersite.com User-Agent , value: Mozilla/5.0 Http method: GET tempUri.Host: www.referre...

fluent nhibernate not caching queries in asp.net mvc

I'm using a fluent nhibernate with asp.net mvc and I not seeing anything been cached when making queries against the database. I'm not currently using an L2 cache implementation. Should I see queries being cached without configuring an out of process L2 cache? Mapping are like this: Table("ApplicationCategories"); Not.LazyLoad(); C...

Entity Framework Update Entity along with child entities (add/update as necessary)

I have a many-to-many relationship between Issues and Scopes in my EF Context. In ASP.NET MVC, I bring up an Edit form that allows the user to edit a particular Issue. At the bottom of the form, is a list of checkboxes that allow them to select which scopes apply to this issue. When editing an issue, it likely will always have some Sc...

Best practices for deploying an MVC application on IIS7

I'm not a web admin, and I'm new to IIS. So, I'm looking for advice. My MVC application (e.g. fooapp) is the default application for my site (e.g. foo.bar). I used IIS Manager to add the site to IIS7. When I import the application, IIS Manager wants to put it in it's own directory (/foo), and tells me I shouldn't put it in the base (sit...

Force lowercase property names from Json() in ASP.NET MVC

Given the following class, public class Result { public bool Success { get; set; } public string Message { get; set; } } I am returning one of these in a Controller action like so, return Json(new Result() { Success = true, Message = "test"}) However my client side f...

possible to $.post and get a file download dialog back

Hi All, I'm using jquery's $.post and was wondering if I can use this to get a FileResult back? Not having any success yet? The content is coming back in the callback but not as a file download? Thanks, rodchar ...

JQuery error in IE, works with FF. Maybe a problem with live.

Hello. I have an ASP.net MVC2 application. In wich I'm using JQuery to alter all table rows so I can click anywhere in any row to trigger a click event on a link in the clicked row. The tables is created using MVC's built in partialview ajax. Here is my JQuery script. <script type="text/javascript"> $(document).ready(functi...

Trouble with loading jquery onload.

Hi guys, I'm trying to build some jquery tabs based on the request (which is stored in a table). I have two pages sharing one .js file. One page is for the user to create the request, and the other is for the administrator to approve/deny the request. On the admin page, here is my javascript code: $(function() { GetReques...

get current logged in userID in aspnet mvc membership

hi, i am trying to show a list of users of my application "school", when admin logs in then he can view all the users in list but when school principals logins, he should get only users of his school, So i thought to get the current loggedIn userId first and then by that userId i'll get schoolId since userId is foreign key in school tabl...

visual studio 2008 , asp.net mvc

Hello I was wondering how to get the starter template for asp.net mvc showing in vs2008 I currently have mvc installed , have been working with VS2010 but need to create a separate project for VS2008. How can I get the MVC template showing up for VS2008 ...

In ASP.NET MVC, what is the equivalent of ASP classic's server side includes?

I have been developing in classic ASP for about 2.5 years and I am trying to update my skill set to include ASP.NET MVC. What is the MVC way of executing SSIs? IE: How can I include a database drawn navigation list in a sidebar? I have been looking into partial views, but they seem to get their content from the controller. As far as I c...

Cannot connect to SQL Server from ASP.NET MVC app

I have an ASP.NET MVC app that has on a hosted server for over a year, connecting to SQL Server. I've had to change hosting services, the new one supports MVC 1.0. I've also moved a non MVC ASP app to the same hosting service. Now, MY MVC based app retturnes this error when I try to validate a user login. A network-related or instanc...

ASP.NET MVC CheckBoxes Problem

Repository namespace MvcApplication1.Models { public class GroupRepository { EgovtDataContext db = new EgovtDataContext(); public IQueryable<Group> FindAllGroups() { return db.Groups; } public IQueryable<Group> FindGroups() { return from Group in FindAllGroups() orderby G...

How could I insert a string into the response stream anywhere I want?

There may be an easy way to do this but I can't see it... I created a simple Http Module that starts a timer on the PreRequestHandler and stops the timer on the PostRequestHandler to calculate the time it took the page to load. I then create some simple html and write my results to Response.Write. Since I'm doing this in the PostReque...