asp.net-mvc

How does ASP.NET MVC link views and controllers?

What code does Visual Studio add (and where is it put?) when you right-click the controller method to link to the view? How can one do this (link the controller & view) without Visual Studio? ...

What wiki would you recommend to base a new wiki solution upon?

Using C#, preferably Asp.net MVC I want to implement a wiki solution which consists of a unique markup language and article display. However I also want to provide standard wiki features such as RSS, Versioning, ext. What existing wiki would you recommend me to base upon? ...

asp.net mvc changing one menu based on which controller is selected from another menu

Hi, I am envisioning a site layout like this- top navigation menu linking to maybe 4 or 5 indexes of different controllers. each of these sections will be working with different model objects. Left navigation menu is specific to a controller. so, for each of the top menu buttons (corresponding to different controllers) I would like ...

ASP.NET MVC Action Parameter Naming

Using the default route provided, I'm forced to name my parameters "id". That's fine for a lot of my Controller Actions, but I want to use some better variable naming in certain places. Is there some sort of attribute I can use so that I can have more meaningful variable names in my action signatures? // Default Route: routes.MapRoute...

How do I share a data context across various model repositories in ASP.NET MVC using linq2sql

I have a 2 repositories in my application each with their own datacontext objects. The end result has me attempting to attach an object retrieved from one repository to an object retrieved from a different repository which results in an exception. ...

Response.RedirectToRoute with an action specified

I wish to redirect to a route but also specify the action to run on that route's controller. I tried this: Response.RedirectToRoute("Login", new { action = "ChangePassword" }); The action looks like this: public ActionResult ChangePassword() {} The route looks like this: routes.MapRoute("Login", "Login/{action}", new { controller...

JQuery Autocomplete on ASP.NET MVC view

I have a working jQuery Autocomplete (the one by bassistance) in my view. The problem is I am just not getting this stuff. The MVC action returns JSON data and the plugin reads it out nicely and filter works great - it lists the results and I can choose from the dropdown. But then when I choose it nothing happens - I select an item eithe...

A general validation attribute for checking uniqueness in a linq to sql data context

I've been programming asp.net for, oh, a couple of days now. Here's a question I can't even begin to figure out for myself. I hope it's obvious from the code what I want to accomplish, and I have, but it's not pretty. Furthermore I'd like to use it on whatever table, whatever field, i.e. check the uniqueness of a value against a table ...

How to create a file in memory then send the file to the user through asp.net mvc + jquery?

Hi I am using Dday calendar library and I want to export the users calendars. So I use the Dday to take all the users records and make it into ical format(.ics). Now I want to take this and send it back to the user. However I really don't want to first generate a file on the server then send it to them. If I can I rather do it in in m...

XML-RPC in ASP.NET MVC

I know there is a library for .NET to use XML-RPC - but does anyone know if it can be used in the ASP.NET MVC environment or not? ...

DataAnnotation attribute for checking equality

DataAnnotations: Range, required... got it. But just checking value==5 or value==bool? ...

Call UrlHelper in models in ASP.NET MVC

I need to generate some URLs in a model in ASP.NET MVC. I'd like to call something like UrlHelper.Action() which uses the routes to generate the URL. I don't mind filling the usual blanks, like the hostname, scheme and so on. Is there any method I can call for that? Is there a way to construct an UrlHelper? ...

Sorting a table in asp.net mvc

Hi all, I was wondering how people were going about sorting a table in asp.net mvc? I've heard of javascript solutions that work pretty well with non-paged tables, such as jquery's table sorter, but i need a solution that will work with paged tables. The project i'm working on currently uses the following solution, but i find it very m...

File is empty and I don't understand why. Asp.net mvc FileResult

Hi I am trying to use the built in asp.net file result to return a file that I am trying to make through a file stream. I am using Dday.ical to make my calendar for export MemoryStream export = new MemoryStream(); iCalendarSerializer serializer = new iCalendarSerializer(iCal); serializer.Serialize(export,System.Tex...

should all javascript go into a separate js file

What is the criteria if certain jquery or regular javascript should go inline or in a separate js file? ...

Flexible File-Open Dialogue Required thats not <input type="file" etc

I require to allow the user to select a file from the network drive from the webpage and have the chosen file path display into a textbox. I must also be able to set a default directory for the dialogue to open into each time. The problem I have with the traditional approach is that I cannot paste a link in there (incase the user want...

in asp.net mvc default binding, what control on the view would map to a boolean as a parameter in the controller action

in asp.net mvc, it seems like checkboxes bind to array of strings (if they are checked). is there any view control that will bind to a boolean in my controller action public ActionResult Go(bool isBold) { } ...

how to apply css class to mvccontrib grid

I am using mvccontrib grid in asp.net mvc(C#) application. How can i apply css class to the grid thats created for the mvccontrib grid Attributes? I am looking to construct like: <table border="0" cellspacing="0" class="usertable">....</table> By default, the mvccontrib grid has the class "grid". I need to change it to my custom css...

custom error page in mvc

Hi In my mvc application I need to show up the error page using customerror on web.config But watever the error may be, even in web.config i specified some version wrong also it need to show the error page, How can I do this. I tried but url redirect to "http://localhost:1966/Error.html?aspxerrorpath=Error.html" CustomError Tag: ...

deploying mvc in iis

Hi, I'm having 5 mvc application where i need to deploy it in IIS. If I deploy it seprately each in IIS its working. But I need in the following structure. -> MyApplications under this all my mvc application need to be deployed. I'm using IIS 7 and tried in IIS 6.x subversion also, Show error like MyApplication/Mvcappl1 virtual pat...