asp.net-mvc

asp.net mvc 2 menus between 4 controllers

hello I want to have 2 navigation menus- One will be a "Top Level" menu, with 4 choices, each pointing to the index of a separate controller. I would like to have a "Controller-Level" sub-menu on the left of my screen. This will correspond to links relevant to the controller selected in the top menu. The "controller-level" menu is n...

How to clear filter on Telerik ASP.NET MVC Grid

I have a grid that allows the user to filter. If the user changes the search word that is used to populate the grid, the filter from the previous search remains in place. <label for="UserName"> User Name:</label> <%= Html.TextBox("UserName", "") %> &nbsp; &nbsp; <input id="btnSearch" type="submit" value="Submit" /> </p> <div ...

Can ASP.NET MVC Views be re-used across different projects?

This is a follow-up question to this question. It's a nice solution to sharing common Views across many projects using source control. However I have a couple of questions, specific to Subversion I think. Subversion Externals allows you to include a folder from a separate repository in your working copy, so you could define an "Externa...

ASP.NET MVC 1 & MVC 2 RC on Visual Studio 210 Beta 2

Hello folks, I'm about to create a new virtual machine for development. I'm really interested in the new Visual Studio Beta 2 and the ASP.NET MVC 2 RC, but I'm also working on a ASP.NET MVC 1.0 project. Does VS2010 Beta 2 work with both MVC 1 and MVC 2 RC? Will I have problems or it's fine to to that? I will run everything over a Win7 ...

What's the best way to programatically visualize a roadmap on the web?

We have a list of deliverables in a database across a number of projects with the data points: Project Function Delivery Date I wanted to figure out the best way of visualizing this on the web in some sort of timeline roadmap view. can anyone suggest any good ways of doing this? I Ideally i would like to be able to click on i...

ASP.NET MVC + IIS7 + FireFox : trailing slash in URL

Note: I have done hours of digging for the answer, and couldn't find one. I have an ASP.NET MVC (2.0) application, hosted on IIS7 (integrated mode). When GET request is made to /Toons/List - I get a redirect (302) to /Toons/List/ which is expected. THE PROBLEM But when I send a POST request, say to /Toons/Add (notice no trailing...

How to Post XML data to a Web Service in MVC

I am very confused on this topic. I have a webservice on another machine. All I need to do is post the xml to the url and return the results to the view. I have not found any working examples of this. Also there seems to be different ways of doing it. What is the best way to post xml data to a url and display the results in a view? Tha...

How can I make !{ } in SparkViewEngine not render anything?

How can I prevent the Spark view engine from rendering the debugging hint when a null ref exception is thrown in !{ }? It always renders "${ expression.that.throws.nre }". The documentation states that it should render an empty string... it never mentions the behavior I'm experiencing. Using settings.SetDebug(false) doesn't change this b...

Why isn't multiselect list showing selected items? MVC

I moved on and then came back to this, but I am still unable to get it to work. var companiesList = subcontractRepository.SubcontractCompanies(Subcontract.subcontract_id); IEnumerable<Guid> selectedList = companiesList.Select(a => a.Id); Companies = new MultiSelectList(companiesList, "Id", "Name", selectedList); ...

JsonResult with Html encoding.

I have to return a JsonResult, which contains some HTML. so, something like: return Json(new { id="guid", html="<param id='id'/>" }); However when I get the result back , the angel bracket are encoded as u003e, u003c , etc.. I tried various encoders but can't figure this one out. Anyone run into this? I can return a Content(string)...

Pass data to a jQuery function on server-side

Hey ho, this is probably a simple question, but I did not find an answer so far. Given I have: $("a.clickable").livequery('click', (function (e) { var values = $(this).attr('id').split('_'); $('#' + values[3]).load($(this).attr('href')); e.preventDefault(); })); You see, I want all links with the clas...

ASP.NET MVC - File Uploading and Model Binding

I'm building an essay contest page. The essay can be written into a textarea or can be uploaded. I'm new to asp.net mvc and have followed along with Sanderson's Pro ASP.NET MVC Framework. I'm having trouble with maintaining the posted file on the round-trip from failing field validation. Reading this I named my input file as the sam...

Asp MVC - "The Id field is required" validation message on Create; Id not set to [Required]

This is happening when I try to create the entity using a Create style action in Asp.Net MVC 2. The POCO has the following properties: public int Id {get;set;} [Required] public string Message {get; set} On the creation of the entity, the Id is set automatically, so there is no need for it on the Create action. The ModelState says ...

Success messages as opposed to model state error messages

For error messages, validation faults etc you have ModelState.AddErrorMessage("Fool!"); But, where do you put success responses like "You successfully transfered alot of money to your ex." + "Your balance is now zero". I still want to set it at the controller level and preferably in key-value way, the same way as errormessages but wi...

ELMAH - Using custom error pages to collecting user feedback

Hey guys I'm looking at using ELMAH for the first time but have a requirement that needs to be met that I'm not sure how to go about achieving... Basically, I am going to configure ELMAH to work under asp.net MVC and get it to log errors to the database when they occur. On top of this I be using customErrors to direct the user to a fri...

How to display value on MVC View Page from Web.Config Appsettings

Hi I need to display a value from Web.Config Appsettings section onto View. I have <%= Html.Label on this View where i need to populate from Appsettings. Ex: If it in ASP.NET, we use ConfigurationSettings.AppSettings["FileServer"]. How can we achieve this in MVC?? Appreciate your responses. ...

Enable "Debug mode" in ASP.NET MVC app through the use of C# directives

My actions in ASP.NET MVC controller are decorated with numerous properties like this [OutputCache(Duration = 86400, Location = OutputCacheLocation.Client, VaryByParam = "jsPath;ServerHost")] [CompressFilter] public JavaScriptResult GetPendingJavaScript(string jsPath, string serverHost) What I would like to do is ...

what is the best web based treemap visualization tool?

i see this but it looks pretty ugly when you have small boxes. Are there any better treemap generators out there? ...

In asp.net mvc, is it safe to have an IDisposable model?

Is the following code sane? public ActionResult MyController() { using(var model=new MyControllerModel()) { return View(model); } //does framework access model after this point? //If so, I need to rethink } ...

How to route GET and DELETE requests for the same url to different controller methods

Here are my routes in Global.asax routes.MapRoute("PizzaGet", "pizza/{pizzaKey}", new { controller = "Pizza", action = "GetPizzaById" }); routes.MapRoute("DeletePizza", "pizza/{pizzaKey}", new { controller = "Pizza", action = "DeletePizza" }); Here are the my controller methods [AcceptVerbs(HttpVerbs.Get)] public Action...