asp.net-mvc

Why System.Web.Cache lost cache once in a while?

I've been using System.Web.Cache for a while for testing purpose. It's quite a nice cache store and speed up my webpage quite a lot. But i don't know there are some case, in which i run for a few more more page, and when I turn back to that page few more time, the page query again ( I checked using a profiler ). Does System.web.cache c...

Call Controler not with full name

Hello All I am new with ASP.NET MVC.we create a controller like this 'AdminController' but call it only with the name of Admin. How ASP.NET MVC handle this that we don't need to call controller with full name? ...

Javascript in Virtual Directory unaware of Virtual Directory

Say I have the site http://localhost/virtual where virtual is the virtual directory I have an Ajax request that is defined in a javascript file using JQuery $.getJSON("/Controller/Action") When this is called, the client tries to find the url at the root level i.e. http://localhost/Controller/Action If I add the tilde (~) ...

ASP.NET MVC Master Page Data

Hi there, The more I use ASP.NET MVC, the more I love it. However, in the case of showing model data on master pages there seems several ways of doing it. I am unsure as to the best solution. My example would be a commerce site where I want to output a list of product categories on every page and also show the status of the visitors ca...

Queries count for page in asp.net mvc

Hi! I want to calculate how much queries are executed when i request a page in asp.net mvc. Difficults in page logic: sum queries are executed in main controller action, but others - in widget controller actions, which are called by Html.ActionLink in master page. I wrote base class for all controllers in which i'm encapsulate query c...

how will you do this in MVC custom route?

www.yoursite.com/image/http://images.google.com.ph/images/nav_logo7.png What I need to know here is the Controller Action, and the Global.asax routes ...

Problem with Url.Content in ASP.NET MVC on Default Route

If I use the following line in my default view /Home/Index <script language="javascript" src="<%=Url.Content("~/Scripts/jquery-1.3.2.js")%>" type="text/javascript" ></script> If I surf to this location using the following url http://127.0.0.1:9999/Home/Index the page gets rendered correctly <script language="javascript" src="/Scripts...

Redirect problem

I have this code in the client side: $.post('<%=Url.Action("Action_Name","Controller_Name")%>', { serverParam: clientParam}, null, null); And this code in the server side: [HttpPost] public ActionResult Action_Name(string serverParam) { return View(); } I currently am in a view and when i click a button i want to be redirected ...

Pass ViewData to RenderPartial

I'm trying to call this method: RenderPartialExtensions.RenderPartial Method (HtmlHelper, String, Object, ViewDataDictionary) http://msdn.microsoft.com/en-us/library/dd470561.aspx but I don't see any way to construct a ViewDataDictionary in an expression, like: <% Html.RenderPartial("BlogPost", Post, new { ForPrinting = True }) %> ...

Deploy MVC without having to take down the whole site.

So lets say I want to make a change to some content on one of my views for my MVC project. Something really simple like taking out a sentence or adding a period or something. So from what I see, I have to republish the entire site, then take down the whole site and replace it with the newly publish set. I was wondering if there was a w...

Preventing Cookie replay attacks in ASP.Net MVC

I have been tasked with implementing point 4 in this article: http://support.microsoft.com/kb/900111 This involves using the Membership provider to add a comment to users server side records when they log in and out, and then confirming that when a cookie is used to authenticate, that the user hasn't logged out. This makes perfect sense...

Unit Testing ASP.Net MVC Action result with call to Server.UrlDecode

We are trying to write Unit Tests in our ASP.Net MVC project. Some of the methods in the controller contain a call to Server.UrlDecode This fails with a null reference exception when called from a unit test. Anybody have a solution for this? ...

Testing an MVC Controller action with an ActionFilterAttribute

A well-known benefit of MVC is its suitablility for Test Driven Development (TDD) because you can directly call your controller actions from your test methods. How can you test the combination of a controller action with a ActionFilter attribute (using OnActionExecuted to modify the ActionResult returned by the Action)? If I just call ...

How to learn JSP/MVC, with previous experience in ASP.Net MVC?

Hi all, I just started to get into the door of the Java world. I have been programming in C# for the last 3 years, and been doing about 3 months of ASP.Net MVC. I absolutely love it, but the fact that I need Windows for it to run the latest and greatest libraries is a bit of a turn down... Plus I think learning another language helps wi...

ASP.NET MVC - Elmah not working and returning 404 page for elmah.axd

Hi there, I'm trying to use elmah for my MVC application and I've followed the steps on the wiki: http://code.google.com/p/elmah/wiki/MVC , but even so when trying to access myapp/elmah.axd the page: 404 - File or directory not found. Anyone could help me please? OBS: My IIS Version is 7.5 If helps I'm posting the pertinent section...

Password Protecting Resources | ASP.NET MVC

Hey Everyone, I am working on an ASP.NET MVC app, and I have some views which I want to password protect. Not in a username/password forms auth type of way. When a user tries to go to one of these protected pages, I want them to have to put in a password. I came up with a way to do this, I just want to get some validation that it is a g...

ASP.net MVC Controller Actions and Web Methods

I am in an ongoing discussion about what is the best terminology to use in regards to what I call "Controller actions" In particular we are talking about controller action that accept a 'POST' verbs only. A colleague of mine prefers to call them "Web Methods", I suspect this is becuase of the old days of Web Services. The behaviour is ...

asp mvc.net Dashboard suggestions.

I'm currently building an inhouse mvc.net reporting app. So far the pages charts etc have been relatively hard coded. i.e. 1 page for this chart, another page for this table. But I'd like to extend it so users have more control over what they're looking at. iow 'A dashboard'. I'd like suggestions on what other people have used and wha...

ASP.NET MVC Dynamic RenderActions in jquery tabs

Ok, so, that title is a mouthfull... But, I reckon you understand what I'm trying to do. I have a page which contains the jquery tabs control, and I render the different tabs by looping through my model. Now, the divs (that are "linked" to those tabs) are also created with the same loop. Hence I have equal tabs + divs connected to those...

Deployment of Asp.Net MVC app on Win2k3 issue

I’ve created an ASP.net mvc application on my windows XP machine. Now, I’m at the stage where I want to deploy my application. I’ve done some googling on how to install/configured MVC apps under IIS 5.1 and 6.0 but I’m still having issues although I’ve done everything, so I believe, by the book. On my XP box, I’ve created a Virtual Dire...