asp.net-mvc

Why is Intellisense missing in parts of an ASP.NET MVC view?

Am I doing something wrong is this a known issue with the ASP.NET MVC beta? <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MyProject.Web.Views.Searching.Index" %> <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <%Html.B...

Are you using VB or C# for MVC Views?

Vote up VB or C# below ! It is slightly frustrating to me (as a C# developer) that VB syntax at least LOOKS better with <% %> tag notation because you get tags like <% Next %> instead of <% } %>. You also get the benefit that the end tags must match the start tags, increasing readability somewhat. ...

ASP.NET MVC being too clever with its routing file and I cant see how!

I have two routing rules in an ASP.NET MVC application : routes.MapRoute( "Products AJAX", "Products/Ajax/{action}", new { controller = "Products" } ); routes.MapRoute( "Product", "...

Why can't i use NVelocity with the Asp.net MVC Beta?

I have added the required assemblies and registered the NVelocityViewFactory in global.asax.cs page but when i run the site i get the following error Could not load file or assembly 'Microsoft.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Any help...

getting selected check box value in Mvc asp.net

I had displayed check box in a list and i want to access that which check box is selected or not and want to call controller action where i select option from dropdown list <div id="pnlSent" style="display: none"> <%= Html.DropDownList("select","msgtype") %> <% foreach (Usp_GetUserMessagesResult w in (List<Usp_Ge...

How do I know what scripts do I need for what Ajaxtoolkit control in ASP.Net MVC

Hi Everyone, I was wondering how do i know what scripts are required for what Ajaxtoolkit control? for instance i know for Datetime control these are requried in the following sequence as seen here BaseScripts.js Common.js DateTime.js Animations.js PopupBehavior.js AnimationBehavior.js Threading.js Timer.js CalendarBehavior.js ...

Keeping up to date with the Microsoft Certifications and the rapid pace of technology releases

How can you remain competetive in the market place and also keep your credentials up-to-date? I am considering going for the MCPD, but im afraid that it will soon be out of date! The current exams revlove around .net 2.0, asp.net, c# 2.0 etc. But in the past few years or so we've had (to list a few): Linq Entity Framework ASP.NET Dyn...

Security and Cross Domain with ASP.NET MVC JsonResult and jQuery

I am using asp.net MVC to develop an application that will have ajax interactions. I have JsonResult methods in the controller returning my json serialized data. So for example when a request is made to http://somesite.com/findwidgets/ mvc serializes the data as json and sends it back. I am using jQuery on the client side to handle the...

In ASP.Net MVC, is using static methods to look up cached objects on views bad practice?

I am creating a portal where many sites will run of the same MVC application. I have a list of Sites stored in the HttpRuntime.Cache. Is it wrong to access the cache via a static method? Should I instead be passing this on view data? For example, is this wrong on the view: <%= SiteHelper.CurrentSite %> Where the code for SiteHelper is...

How can I toggle a list based on a radio button with asp.net mvc?

Suppose I have a list of tickets. When the user first goes to the tickets/index page I want to show all the open tickets and check the radio button with the name ticketStatus and value of Open. If the user checks the Closed radio button with value Closed and name of ticketStatus I want to do a submit and get the list of closed tickets ...

ASP.NET MVC Reference problems?

In doing a MVC project I got the following 2 compile errors The type 'System.Web.Mvc.ViewPage' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The call is ambiguous between the following methods or properties: 'System.Web....

How to validate this scenario in ASP.NET MVC?

First, a little bit of context (cause I know you all love it!): I have a model called Note. It has a field called Type which, in the database, is an integer value that designates which type of object this note belongs to (1 = Customer, 2 = Sales Lead, etc). A second field called Source designates the ID of the specific object that this ...

Data Grid in ASP.NET MVC

Is it possible to use a datagrid control in a mvc "view"? How would I bind it to a datasource? ...

Looking for ASP.NET MVC PartialView and advanced AJAX documentation

I'm doing pretty well getting up to speed with ASP.NET MVC with the ASP.NET website walkthroughts and tutorials. Now I'm fully aware that this documentation is not complete and just Beta, but theres seems to be some important missing documentation. Where can I find the best information about the following topics (that seem to be lackin...

new ActionResult that can render the view generated and send contents via email

I was wondering if it were possible to write a file FileResult that worked something like this. public ActionResult Generate(int id) { //Fill Model string ViewName = "template1"; return new FileResult(ViewName, @"c:\save"+ id +".txt"); } where it would take the model, and combine it with the view to give you the outpu...

Correct way to write an ASP.NET MVC action returning a PartialViewResult

I have written an Action method for an ASP.NET MVC controller, which is being used to provide a model to a usercontrol. public class ProductsController : Controller { public PartialViewResult ProductSummary() { ViewData.Model = new ProductSummaryModel("42"); // dummy data for now return new PartialViewResu...

ASP.NET MVC and Automatic RESTful Features

Does ASP.NET MVC have anything like the RESTful out-of-the-box features like Ruby on Rails 2.0? For example: cURL and Your Rails 2 App I think this is the built in REST access to your Models. Since models can be implemented in different ways in ASP.NET MVC is there a feature like this? ...

Asp.Net MVC Route Table and Controller Actions

I am creating a directory of sorts with members and their profiles. I'm using the MVC framework in .net. I have a view that allows you to find members based on some criteria so my controller has a Find() action result, then another that accepts the post verb. So, somesite.com/members/find displays the search tools, then once the form...

Implementing a simple product dropdown in ASP.NET MVC

What are the different or best ways I can implement a simple product dropdown in ASP.NET MVC, that redirect the user to a new product when they pick from the dropdown ? I have currently have my primary mapping rule : routes.MapRoute( "Product", "Products/{sku}", new { controller = "Products", ...

How to unit test library that relies on Session object

I have several asp.net mvc websites consuming the same controller and model. This common logic is put in seperate libraries. These libraries use the HttpContext.Current.Session. How can I make these unit testable? I read about the StateValue but can't completely grasp it. Where should I get this StateValue thing? Is it a lib I reference?...