asp.net-mvc

Can you have multiple levels of master views in ASP.NET MVC?

Possible Duplicates: Are there nested master pages in ASP.NET MVC? Creating nested master pages in ASP.NET Web Application Duplicate Are there nested master pages in ASP.NET MVC? Can you have a master view in ASP.NET MVC that inherits from another Master View? My reasoning is this: I have some pages that need to si...

$.ajax() call to MSFT MVC failing in ISP, works locally

The following JQuery $.ajax() call in a .js file works locally, but not when I deploy to my ISP. $.ajax({ type: 'GET', url: 'Services/GetActivePatient', async: false, dataType: 'json', cache: false, success: function(pt) { Alert(pt); }, error: function(xhr, ajaxOptions, thrownError) { alert('Error loading active ...

Integrating MVC Futures in Spark view engine without killing intellisense

I want to add MVC futures to my project and make the assembly available in my spark views however it's not accepting it whatsoever. I can use Microsoft.Web.Mvc fine from my classes (controllers/models etc) but they're just not showing up in .spark files. I cannot use <use assembly""/> since that kills my intellisense. And if i try to a...

ASP.NET-MVC and TFS: Getting TF30076 Error

When I try to create a Microsoft.TeamFoundation.Client.TeamFoundationServer object in the HomeController of my MVC application, I receive the following error: TF30076: The server name {TfsServerName} provided does not correspond to a server URI that can be found. Confirm that the server name is correct. I am using Windows Aut...

How to show nested data using MVC Views and PartialViews

The problem I am working on is very similar to the way StackOverflow is displaying Question, its comments, Posts and comments related to the Posts. The hierarchy is the same. How is this accomplished in ASP.Net MVC? So far I have this: (I have named the files similar to SO site to make my question more readable) Views/Questions/Detail...

TinyMCE Spellchecker in ASP .NET MVC

I followed the tutorial described here, in order to make the TinyMCE Spellchecker work on a Webforms application. But I tried to do the very same thing on a MVC project and keep getting errors every time I try to use the spellchecker. I'd like to know what changes or adjustments I need to make in order to make this word on an ASP .NET M...

What is the point of the key parameter in ModelState.AddModelError in ASP.NET MVC?

I enjoy writing validation functions in my controller that modify the ModelState if the validation fails. For example: private bool ValidateMoney(string raw, string name, decimal min, decimal max) { try { var dec = Convert.ToDecimal(raw); if (dec < min) { throw new ArgumentOutOfRangeException(name + " mu...

Extend Viewpage class with custom helper objects?

Is it possible to add a custom helper object to the ViewPage class, so I can use it inside the view page markup (just like Html, Url and Ajax) ? This helper object also needs some data from a custom controller. (which should be possible through the ViewContext property I think) ...

screwturn custom page storage provider

I'm trying to see if we can customize ScrewTurnWiki to fit into our site, so instead of the traditional Page.ashx or Default.aspx?page=abc the wiki pages will be site/section1/page/Wiki site/section2/category2/Wiki site/sectionXX/categoryYY/PageZZ/Wiki where the pageName for each becomes Section1/page Section2/Category2 SectionXX/Cat...

Posting complex types using Jquery to Asp.Net MVC

I am trying to make a rest service that receives complex types from a Jquery $.ajax post but I cannot seem to convince mvc to hydrate my complex objects in the controller. The following is some of my code: Controller: [AcceptVerbs(HttpVerbs.Post)] public ActionResult ChargeUser(TransactionInfo transactionInfo, CardInfo cardInfo) { //...

When is the Session Property in Controller Initialized?

When is the Session property in Controller Initialized? From what I see it is not initialized when the constructor is called. So when it's initialized? ...

Grouping fields in ASP.NET MVC

I am working on an ASP.NET MVC application which has a model for a business, linked to another model (business trading hours) in a one-to-many relationship. When creating this entity we have a form where we would like to provide a fixed set of the BusinessTradingHours entities, so I have used something like the following (kind of what I...

Why can't my host (softsyshosting.com) support BeginRequest and EndRequest event handlers?

I heard good things about Softsys Hosting and so I decided to move my ASP.NET MVC solution over to them. But it would not run on them. I was able to pinpoint the problem to my BeginRequest event handlers. If I had them I'd get an error. Here is my code. protected void Application_Start() { RegisterRoutes(RouteTable.Routes); ...

ASP.net MVC Routing Throws Exceptions as Normal Behavour?

I was debugging my current project (ASP.net MVC 1.0 project) and stumbled upon slightly disturbing behavour. It seems that when the router is hunting for a referenced partial view aka <%Html.RenderPartial("AccountListControl", ViewData["AccountList"]); %> It cycles through it's default locations until it finds the correct spot. So i...

"A potentially dangerous Request.Form value.." error when ModelState.IsValid is false

In one of our ASP.NET MVC application we are using FCKEditor to allow users to enter rich text. In order to turn off the validation in the controller actions we set the attribute [ValidateInput(false)] Users are able to save and modify the rich text as long as there are no business validation errors in the page. If any of the busin...

ASP.NET MVC: Submit renders the same page

I'm trying to add simple login page to ASP.NET MVC app. I actually use Sharp Arch template project. So, I added 3 methods Login(), Logout(), and DoLogin() to UsersController, where Login() just does return View("Login"); Now, when I navigate to /Users/Login, my aspx is displayed with submit button: <%@ Page Language="C#" MasterPageFile...

Is an abstract CRUD controller a good idea?

We're developing quite a big application using ASP.NET MVC and at the beginning we saw that could be useful to have an abstract base controller with common CRUD actions (new, save, delete...) plus a default list action. In our case we have 20+ entities that are managed through this kind of controllers. That works and avoids duplicating ...

How do I change the default input format on the DateTime model binder in .Net MVC?

I have a fairly standard .Net MVC Controller method: public ActionResult Add(Customer cust) { //do something... return View(); } Where Customer is something like: public class Customer { public DateTime DateOfBirth { get; set; } //more stuff... } And a page containing: <div><%= Html.TextBox("DateOfBirth") %></div> Th...

Using JavaScript to scroll through a list of items in ASP.NET MVC

Hello, I'm new to ASP.NET MVC and also to JavaScript. What I've got currently is a simple webpage that displays information about employees that is read from a database. Part of the information regarding an employee are his paychecks. Currently I receive this information in an array from the site controller. What I want to do is to use ...

Html problem. Anchor tags href not working [Really Weird]?

Edit: closing anchor fixed - This issue exists when testing on the following browsers Google ChromeFirefox 3.5Safari Works with no problems on IE 8 Hey guys, I'v a really weired problem here! In short, take a look at the following html: <a href="login_page.html" class="img"> <span class="img_holder"> <img src="images/columnists/mi...