asp.net-mvc

How to keep search term for additional pages when paginating

Hi all, I'm using a pagination method for displaying search results returned from my database. I'm creating an Html.ActionLink for each extra page, and what I'm wondering is, how do you put the string that was searched into the ActionLink? Below is part of my partial view that I'm populating a div with. It comes after the results so the...

Lucene.NET Performances Concerns with ASP.NET MVC

Hi, I'm currently developping a web site with asp.net that use Lucene.Net to perform fulltext queries. The web site display a couple of data lists. The problem is that i perform fulltext queries FOR EACH items displayed in the list which can be a performance issue. So i wonder if i should "pre fulltext query" with a kind of Search En...

Using ASP.NET Caching on top of NHibernate 2nd Level Caching

Should i consider using ASP.NET Caching to cache query results on top of NHibernate 2nd Level Caching to improve performances ? ...

ASP.NET MVC Model vs ViewData For Select Lists

I have an ASP.NET MVC application with quite a few drop-down lists and multi-select lists. Essentially, a lot of lists of options. My question is; is it better to pass these lists to the view as part of the Model, or as ViewData? I am currently passing them as ViewData as I don't really need them on the model and they seem potentially ...

How can I add a new Table with a Button click event MVC?

I have a table with text box asking for Name and Address for reference. If need be, I would like the user to have the ability to add more and not be restricted to just one. How would I add a new table to a form by clicking on my "getMore" button? <table style="width:50%;"> <tr> <th colspan="2">Reference</th...

RedirectToRoute("Default") Not Redirecting, Returning LogOn PartialViewResult's HTML Instead

Account Page opens like normal: public ActionResult Index() { return View(); } this goes to render the following View template: (because at this point there is no CurrentUser, 'user' is null, so it runs Html.RenderAction("LogOn", "Account");) <% var user = (WAPConfigUser) HttpContext.Current.Session["...

Profile System: User share the same id

I have a strange effect on my site when it is under heavy load. I randomly get the properties of other users settings. I have my own implementation of the profile system so I guess I can not blame the profile system itself. I just need a point to start debugging from. I guess there is a cookie-value that maps to an Profile entry somewh...

Subsonic Exception - The member 'TestMode' is not supported

Hi! i´m using LINQ with the subsonic in a class to get my data here is the code below: public IQueryable<Veiculo> SelecionaVeiculosSite() { return (from v in _db.Veiculos where v.Ativo == true && v.Marca.Ativo == true && v.M...

ASP.NET MVC2 - Custom Model Binder Examples

I am trying to find some examples of building a custom model binder for a unique binding scenario I need to handle, but all of the articles I found were for older versions of MVC which are no longer relevant in MVC2. I've been referencing the DefaultModelBinder source code to try to get a general feel for what I need to do, but it's enti...

Using webform user control on webform in MVC Project

I am using a server control on a single web.forms page. I have to use this control on a web.forms page since its a server control, although this is actually a MVC project. So I created a web.forms folder and put my new page in it. I then copy the example code from the signature control. I get the following error: The base class includes...

ASP.NET MVC and strongly-typed partialview

I'm loading a partial view with an AJAX call: public ActionResult LoadServerForm() { //data stuff ViewData["ApplicationID"] = appID.ToString(); ViewData["Servers"] = ServersList(appServerRep.Session, null, appServers); return PartialView("Application_AddServer"); } This ...

Customizing Autofac Controller registration

I am trying to use Autofac and Autofac.Integrations.Web to register ASP.NET MVC controllers. I am currently using assembly scanning to find the controllers but one of them needs a special parameter that I would prefer to pass in instead. Found below are the registrations I have tried. var builder = new ContainerBuilder(); builder.Regis...

Problem Implementing StructureMap in VB.Net Conversion of SharpArchitecture

I work in a VB.Net environment and have recently been tasked with creating an MVC environment to use as a base to work from. I decided to convert the latest SharpArchitecture release (Q3 2009) into VB, which on the whole has gone fine after a bit of hair pulling. I came across a problem with Castle Windsor where my custom repository inte...

RedirectResult not working with jQuery.post()

Hi Guys I'm trying to do an asynchronous login. When the user is authenticated I want to redirect to the user's originally requested page. The problem is that the Action Method is returning a Redirect type of ActionResult and the jQuery doesn't seem to know what to do.. I'm using the following jQuery: $("form").submit(function(event) ...

asp.net site dying as it starts up for unknown reason that I think has to do with VS 2010RC

Environment: Win 7x64, VS 2010 RC, Resharper 5 beta, MVC2 RC, git When I reboot my machine, my website, configured in IIS, seems to be fine. As soon as I load VS, and try and debug from it, the site becomes completely unresponsive. I can't even get it to serve images. I have the website in IIS pointed directly to the folder with my w...

How to specify default Area without adding area = "" to every ActionLink

I have a large existing application built on ASP.NET MVC2 RC2. All of my links look like this: htp//site/controller/action/id I just added an Area called: BigBird. Now when I'm in the BigBird area, all of my links look like this: htp://site/BigBird/controller/action/id Problem is that none of those controllers/actions exist in my n...

Is it possible to use data annotations for LabelFor,ValidationMessageFor, EditorFor with strongly typed resources?

I would like to use DataAnnotations in my ASP.NET MVC application. I have strongly typed resources class and would like to define in my view models: [DisplayName(CTRes.UserName)] string Username; CTRes is my resource, automatically generated class. Above definition is not allowed. Are there any other solutions? ...

TDD'ing MVC Controllers to drive design

Hi, I am starting out on a new project (well, restarting an existing one), and trying to adopt TDD (for the nth time) for all the benefits that it should bring. I believe that TDD will result in my tests driving me to write only the code that I need to write, but it will drive me to write the code that I NEED and not leave some out. T...

Html.TextAreaFor not writing the value...? (ASP.NET MVC 2.0)

basically, im calling Html.TextAreaFor to display a form, which is great/not a problem... people enter text in it, and it gets submitted, and if it is successful, i want to return an empty Html.TextAreaFor... but after it's submitted, in the action method i am clear to set the Comment that people are making in the TextArea to an empty s...

How to automatically maintain a table of users that have been authenticated by IIS 7.0 using Windows Authentication

I want to build and maintain a table of users. All users that access the ASP.NET MVC site are authenticated via Windows Authentication so they're bound to have a unique username. I'm grabbing the user name from: System.Web.HttpContext.Current.User.Identity.Name I feel like I could go two ways with this. Anytime the user table o...