asp.net-mvc

Home Pages in ASP.NET MVC

I'm trying out ASP.NET MVC, but, after reading a huge tutorial, I'm slightly confused. I understand how Controllers have Actions that URLs are routed to, but how do home pages work? Is the home page its own controller (e.g. "Home") that has no actions? This sounds correct, but how is it functionality implemented without Actions (no Actio...

Passing null child object from parent object to a partial view

I have an object which contains models for my ASP.NET MVC web app. The Model that is being passed into the view has sub models for "gadgets" on that particular view. Each of these sub models gets passed to a partial view (gadget). The problem is when I have a null model in the view model. See example below. View Model: public class Fo...

ASP.NET MVC Strongly Typed Partial View, gives could not load type error

I am attempting to create a strongly typed view with a "MVC View User Control" that is being rendered using Html.RenderPartial(). The top of my ascx file looks like this: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Collections.IEnumerable<string>>" %> There is nothing else on this page, currently. When ...

Themeing and Master Pages

I have the requirement to support themeing of my site's pages. The way I am doing this is by dynamically choosing a master page based on the current theme. I have setup a directory structure like so /shared/masterpages/theme1/Master1.master /shared/masterpages/theme1/Master2.master /shared/masterpages/theme1/Master3.master /shared/ma...

HTML element not accessible with jQuery

Hello, I have a via with some jQuery function to get value from HTML element (to access element available and element not yet available). On of these element is a dropdown, when I select a value an another vue is added in the bottom of the page in a div. When I try to access an element added by this view, I received "undefined". What ca...

ASP.NET MVC - POST Action Method with Additional Parameters from URL

With ASP.net MVC is it possible to POST a form to a controller action which includes parameters not in the form, but from the URL? For example The Action method in GroupController: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(int idOne, int idTwo, Model model) { ... } The route: "{controller}/{action}/{idOne...

What is the best way to get support from microsoft developers

I have a problem at my production web, that I am not able to solve. I am not able to reproduce the problem in stage or development. It only appears when the website is under heavy load. I think it is solvable if somebody who has a very good understanding of the internals of FormsAuthentication would have a look at it by logging into ou...

ASP.NET Forms Authentication expiring even with activity

I have a ASP.NET MVC site which uses ASP.NET Formsauthentication I have the ticket set to expire after 20 minutes of inactivity. However it is expiring after 20 minutes no matter what. I guess what I am asking is, is this the right functionality of it or do I have some issue and if so a solution to this would be appreciated. ...

asp.net application install folder

Disclaimer: this is not a question about how to install asp.net or an application using it! Hi! I am pretty sure many of you have once installed some kind of forum, blog or CMS (mostly PHP powered applications). All of these contain a folder mostly named "install" where (after you copied the files to the webserver) point your browser t...

Validation Summary for Collections

Hi All, EDIT: upgraded this question to MVC 2.0 With asp.net MVC 2.0 is there an existing method of creating Validation Summary that makes sense for models containing collections? If not I can create my own validation summary Example Model: public class GroupDetailsViewModel { public string GroupName { get; set; } public int Nu...

ASP.NET MVC Response file should not download

I am generating a .cxml file on the server and pushing it to the browser based on certain queries. If I just link to a .cxml, it does what I expected and opens it in the respective application. How can I generate a file and push it to the browser just like if it was linked to a file without it asking me to download it? The link looks s...

How to implement a search page which shows results on the same page?

I'm using ASP.NET MVC 2 for the first time on a project at work and am feeling like a bit of a noob. I have a page with a customer search control/partial view. The control is a textbox and a button. You enter a customer id into the textbox and hit search. The page then "refreshes" and shows the customer details on the same page. In othe...

how to write use cases of asp.net mvc

hello friends.. i need to write a use cases to test the asp.net mvc applicatoin.. please can anyone help me out.. thanks ...

Error when specifying tag attributes in NHaml

I am just getting started with NHaml and ran into a snag. This is my application.haml file: %html %head %title = Get Some Data %link{ href="/media/css/styles.css", rel="Stylesheet", type="text/css" } %body %div.page %h1 = Get Some Data _ When I try to view in a browser it throw the following error: NHa...

Building Web Apps using MongoDB and ASP.NET MVC, Should I Use C# Drivers or Javascript Driver

I am developing asp.net mvc web app with MongoDB as the data storage. I want to know others opinion about what drivers to use. Should I use C# drivers which is supported by community? Or, should I go to use Javascript driver which is supported by Mongo. How stable is javascript driver? Thanks in advanced.. ...

Can i have the following route in ASP.NET MVC :: http://whatever/controller/action.format

Hi folks, is it possible to add a dot format / .format to the end of any route in ASP.NET MVC .. with a default being html or something? and of course the .format is an optional value. sample routes:- http://whatever/controller/action.format http://whatever/controller/action those goto the same action method. cheers! ...

Telerik MVC: Telerik Menu Drops down Under Telerik Grid

I have just added a Telerik menu to my MVC application. I also have many views that render Telerik grids on them. Problem: My menu has one item with sub items. When I hover over that menu item, the dropdown slides beneath the Telerik Grid, which hides most of the sub items and makes it impossible to click them. Any idea how to make ...

Problem with asp.net mvc route not firing when in <script> tag

I cannot get the following route to fire when a url is requested from a script tag. I have the following route: // maps to "/cache/cachecontent/JavaScriptInclude/1/javascript" routes.MapRoute( null, "cache/{action}/{key}/{version}/{type}", new { controller = "Cache"...

Getting the error "The view at '~/Views/Page/home.aspx' must derive from ViewPage, ViewPage<TViewData>, ViewUserControl, or ViewUserControl<TViewData>"

I've just installed MVC2 and I've got a view that looks like this <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Home </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID...

Display/hide menu items depending on logged on user

In my web app, I would like to show an "Admin" menu link only to users who have been added to the database as an administrator. What would be the best way to do this in ASP.NET MVC 2? At the moment, I am doing it by checking whether the user exists in the Admin database table for every page. Obviously, there must be a better way to do ...