asp.net-mvc

Grouping controlers in Asp.NET MVC?

I would like to create a sub folder in the controllers folder of an Asp.Net MVC application. But when ever I do this and try to navigate to a page the controler can not be found. Here's a concrete example. Currently I have: Controlers/UserAdminControler.cs Controlers/PageAdminControler.cs Controlers/MenuAdminControler.cs Controlers/Som...

When should I avoid using strongly typed viewdata?

I'm enjoying the lack of "magic strings" in my views and controllers but are there any draw backs to this approach? It doesn't seem like there are. I've read blog entries here and there implying otherwise though. ...

Show process status using AJAX and ASP.NET MVC

I have a method in my controller that kicks of a job on the server. I'll use a Ajax call (jQuery) to start this via a link on the page. This can take a while and I need to show some status on the page. I don't necessarily need "26% done ..." but more a status showing "working" or "done". How do a get jQuery to continuously pull for the...

How do I implement the Stack Overflow search box?

In the interest of sincere flattery I would like to emulate the search box that Stack Overflow presents its users at the top right of the screen. I would like to be able to duplicate the AJAX/type ahead nature of this text box as closely as possible (but over my own data set). Does anyone know if this is custom built control or does it...

Disabling links with JQuery

I have the following code which does a function similar to the way the comment link works here on Stackoverflow... when clicked it triggers a ActionResult and populates a div $(function() { $("a[id ^='doneLink-']").live('click', function(event) { match = this.id.match(/doneLink-(\d+)/); container = $("...

Problems with Html.DropDownList in ASP.NET RC1

For some reason my drop down list is not retaining it's selected value - I know I am missing something simple here. Thanks for any comments! Controllers public ActionResult Test() { ViewData["MonitoringType"] = new SelectList(myModel.GetMonitoringType(), "Category", "Category"); return View(); } [Accept...

How do I stub the HttpSessionState in MVC RC1 with rhino mocks?

I'm trying to take advantage of the recent ControllerContext refactoring in asp.net mvc rc1. I should be able to stub the session rather simply but I keep getting a System.NullReferenceException on line 2 when running the following code: var mockContext = MockRepository.GenerateStub<ControllerContext>(); mockContext.Stub(x => x.HttpCont...

post <Asp:DropDownList> value with action link (asp.net MVC JQuery)

I have an on my MVC View page. I use JQuery to filter a grid when the selected index changes. At the bottom of the page I have an action link that. I would like to post this value to the controller that the action link is pointing to. The problem is, obviously the value of the box can change. How could I post dynamically changing d...

ASP .Net & SessionState

Looking at the MVC source today: public class MvcHandler : IHttpHandler, IRequiresSessionState why does it need SessionState? Isn't MVC trying to do something RESTful? I know the reason for using session state in MVC is for transferring some data (can't remember the term but session state can be substituted with other mediums ). I thi...

ASP.NET MVC - Returning two repositories to the View

I am currently learning ASP.NET MVC so please excuse my question if it has been asked or seems rather simple, but if I could get some help I would greatly appreciate it. I am trying to return two different repositories to the View. I am going through ASP.NET MVC's tutorials and I thought I would try taking it a step further. I can disp...

UpdateModel won't properly convert a boolean value

I have a custom object called S2kBool that can be converted to and from a regular Boolean object. Basically, it allows my application to treat boolean values in my legacy database the same way it treats C# booleans. Then problem is, when I attempt to use a check box to set the value of an S2kBool property, it fails. Code like this works...

Why is Controller.RouteData.Route null ?

I'm trying to display a small panel during debugging in my application with various miscellaneous functionality. One thing i want it to contain is information about the current route. I tried to look at Controller.RouteData but some of the properties were null. RouteData.Route - null RouteData.RouteHandler - null RouteDat...

MVC and lambda's for creating a record

Hi, I'm trying to add a record to a database. My Model is fairly simple: A Project table with a companyId field that associates to a Company table. Here's were I'm stuck.. var companyTemp = collection["company"]; var company = isspDB.Company.Where(co => co.companyId == 1).First(); What I basically need is: var company = isspDB.Com...

Why do HtmlHelpers need an argument to this HtmlHelper helper?

Why do HtmlHelpers need to be declared with an argument to an HtmlHelper helper? i.e public static string ScheduleEntries(this HtmlHelper helper, ...) I've never noticed that syntax before in C#, what is it called? Thanks -Matt ...

Command-line to "deploy" ASP.NET MVC project

I am using Visual Studio Team Suites to develop a ASP.NET MVC project. I can deploy the web app to my dev machine using the "deploy" item from IS. Is there a command-line tool to do this task? What I am trying to do is to setup a continuous integration server (using TeamCity Pro), so that whenever I checkin new code, I will get a new bui...

Html.DropDownList in ASP.NET MVC RC (refresh) not pre-selecting item

In my controller, I have the following: ViewData["myList"] = new SelectList(itemRepository.GetAll(), "Id", "Name", currentItem.Id); And in the view I have: <%= Html.DropDownList("myItem", (SelectList)ViewData["myList"])%> The rendered drop down list should have the item with the Id of currentItem.Id pre-selected but it doesn't....

How to maintain state of Html.Listbox() in ASP.NET MVC

Hi, I have just started wrking on Asp.net MVC. For filtering a table i am using a Html.listbox() to select multiple items and a button to apply filter on the table. <%=Html.ListBox("CategoryOptions", new MultiSelectList(TypeModel.Category))%> But after clicking the filter button ,the listbox doesn't show(maintain) the items as s...

Getting Started with the Web Client Software Factory But i don't find Solution picture?

i downloaded add start set up MVP Software, After setup finished, i don't find mvp C# solution (like: asp .net mvc solution, or asp.net Silverlight Solution) in list of project type ? i need a list of project list like start up asp.net solution for example: if i click new project, .net give me type of alternative solutions, So i choose...

How do I create an ASP.NET MVC wizard with back button support?

I am creating an app with ASP.NET MVC and I have the need for a wizard style interface on one of my pages. Here is what I'm doing so far: I have created a page with 5 divs. All have "display: none" set in the css file. When the user hits the page for the first time, I use jquery to show the first step using: $("#callStep1").show(...

Include MVC views and master pages as DLL resources instead of separate files

Does there exist a method when publishing an ASP.NET MVC application to completely remove the .aspx view files (and if possible .master too) by compiling them into the application DLL as resources? The published application would just be the /bin folder, Global.asax and web.config, a default.aspx if needed, and whatever is in the /Conte...