asp.net-mvc-2

I can't pass a value to view

Hello I am just playing with ASP.NET MVC 2 for learning. I can pass my models to view but after spend 1-2 hour i am unsuccessful to pass data to view.For example: www.example.com/home/show/asdf i am trying to get asdf string for show it on screen. public ActionResult Test(string ID) { return View(ID); } With thi...

Client side processing in asp.net mvc 2.0

We are looking on an implementation in which data is processed at client side. Need inputs on how to process the data in JSON or any other type at client side in ASP.Net MVC 2.0. Details: Inputs are accepted from the user and required to be saved in a list (or any other object) at the client side. Once the user actions are complete, the...

can spark inherit a regular master page

I have an existing mvc app. I've decided that i would like to use spark. My plan is to slowly migrate the whole site to spark. Will i have to create 2 master pages, ie one for .aspx content and one for .spark content. Is there anyway i could use one master page for both. ...

How to convert class to inherited class while using ActiveRecord

I've got a class Project and a class Case, which inherits from Project. When having a list of Projects we might decide later on to make a Case of the selected Project. How can I achieve this? Project: [ActiveRecord (Table = "projects", Lazy = true), JoinedBase] public class Project : ActiveRecordValidationBase<Project> { priva...

MVC2 LogOnModel not found.

So i've been working on a MVC2 application just to learn the ropes really. One thing i did not like about the default set-up is that the views, models and controllers were in a single assembly together. This was not hard to overcome, moved both to different projects and migrated each folders contents over. However, now time has come...

How do I get the source element in the AjaxOptions OnComplete function with MVC Ajax.BeginForm

As the title, I need something along the lines of... using (Ajax.BeginForm("MyAction", new AjaxOptions { OnComplete = "function() { mySucessFunction(this); }" })) <script> function mySucessFunction(srcElem) { alert(srcElem.id); } </script> An...

ASP.NET MVC vs Silverlight for an internal application

Hi, I'm in the early planning stages of an internal application and I'm considering ASP.NET MVC and Silverlight 4 as my possible platforms. The Environment We're a Microsoft shop and we're in the process of migrating desktops to Win7 (from XP) and servers to W2k8, I'll be able to get Silverlight 4 installed as part of our baseline Win...

How to have more than one silverlight application in an ASP MVC project?

I have an ASP MVC application which uses some silverlight applications in the View. By now, I hava a map, that, when a State is clicked, redirects to the related page. Now, I need a silverlight application in which state, with the state map and the location of the harbors on this state (you chose a state in the first map, than you get re...

ajax.beginform onsucess updatetargetid hidden input

I am trying to call a jquery ui dialog by attaching the function to the onsuccess property of the ajaxoptions on a ajax.beginform.. <script type="text/javascript"> // Dialog $(document).ready(function () { $('#dialog').dialog({ autoOpen: false, width: 600, modal: true, butt...

MapRoute problem using T4MVC

Hello, I do use T4MVC v.2.6.15 I have following problem with registering routes. I didn't have it with default MVC route register. My problem route is following: AddRoute( routes, "Songs", //new { controller = "Songs", action = "List", performerUrlTitle = "", page = 1 } ); MVC.Songs.List( "", 1 ) // M...

Implementing a class-level validation attribute that writes to a property inside the class

I'm building an ASP.NET MVC site where I want to decorate my ViewModels with validation attributes. One of the things I want to validate is that the address that a user submits through a form is geocodable. For that, I have already created a custom ValidationAttribute and have applied to my StreetAddress property. This is all good, exce...

ASP.NET MVC2 CrAzY Characters in View Output - WTF

Every once in a while when I'm running my app I get really "REALLY" strange characters in my output instead of the appropriate page. Now I know that this is because of some error, but unfortunately the error doesn't present it's self, but rather just produces strange characters. Here's an example of a complete page source code. �...

SubSonic SimpleRepository Find Method with nullable DateTime

using SubSonic3 SimpleRepository; I have a table used for an email queue which has a SentOn DATETIME column that allows nulls. Using the following Lambda expressions have yielded me errors, does anyone have any ideas how to select a list from the table were the column is null. IList<Email> emails = _repo.Find<Email>(x => x.SentOn == n...

Is There an HTML Tidy tool/library for asp.net mvc?

I love how the html tidy tool works online. Is there a tool for this that beitifies html in real time? ...

How do I invoke UpdateModel from within a Custom ModelBinder? (MVC)

Hi, I'm creating a few custom binders for complex types in my Model. My model is composed of objects that have their own separate binders. I want the base object to do its dirty work and then populate the complex object it encapsulates by passing off to the standard ModelBinder routing. How do I do this? For illustration purposes I'...

MvcSitemapProvider is returning all in Https instead of Http

hi, i am using MvcSitemapProvider and is working fine, but its returning all results in Https instead of Http. i am unable to find a way to return the results in http (sitemap for search engine) <mvcSiteMapNode title="Details" controller="Home" action="News" dynamicNodeProvider="DynamicPostDetailsProvider, MyNamespace" updatePriority=...

actionlink not resolving urls related to route

I have the following route ( it's the first in my global.asax ) routes.MapRoute( "AdminCompany", // Route name "{controller}.aspx/{action}/{companyId}/{id}", // URL with parameters new { controller = "Home", action = "Index", companyId = "", id = "" ...

Unit testing ASP.NET MVC Controller methods through concrete class or interface

Hey everyone, I'm writing some unit tests for some controller methods in my project and am wondering whether to test against the controller class itself or an interface of that controller. Should I be creating an interface for each controller and run my unit tests against that? ...

Render partial in an extension method fails

I'm creating a tabcontainer that shows information from partials. The code that i've created is as follows: //Entering extension method, m_helper is of type HtmlHelper foreach (var tab in m_tabList) { sb.AppendLine("<div class='tabContent'>"); m_helper.RenderPartial(tab.PartialName); sb.AppendLine("</div>"); } //Returni...

C#3.5 MVC2 routing skip optional param

Here I have: routes.MapRoute( "test", // Route name "DataWarehouse/Distribution/{category}/{serialNo}", new { controller = "DataWarehouse", action = "Distribution", category= UrlParameter.Optional, serialNo = UrlParameter.Optional } ); Category and serialNo are both optional params. When ...