asp.net-mvc

Routing issue in Asp.Net Mvc

I have a list of puzzles that are tagged with specific "Themes". Think questions on stackoverflow tagged with certain categories. I'm trying to get my route setup so that it works like this: http://www.wikipediamaze.com/puzzles/themed/Movies http://www.wikipediamaze.com/puzzles/themed/Movies,Another-Theme,And-Yet-Another-One My routes...

What is the best solution for displaying data in ASP.NET MVC?

I am new to ASP.NET MVC and I want to know your opinion about what is the best way to display some data from database using a <table>... an ASP.NET control or a jqGrid? In which situation must each of them be used? I appreciate any tips. Thanks. ...

What's the best way to embed constant server-side tags inside javascript code?

I have a bunch of javascript functions which depend on some server-side constants (such as strings from my resources file). While I was developing them I kept the javascript code in the view header, so I could simply used server-side tags inside my javascript code, but now I'd like to move the javascript functions to a separate file. I...

Paging in asp.net mvc c#

public ActionResult Index(int? page, FormCollection collection) { query = GetClients(collection); var pagedView= new PaginatedList<Clients>(query, page ?? 0, pageSize); return View(pagedView); } The above works if i am on page 1. When i click on page 2 link it fails for the reason that 'collection param is null and GetClients ...

Nonsensical Parsing Errors after Removing Code Behind from ASP.NET MVC Project

Hi all, I've recently upgraded an ASP.NET MVC Project written with the Beta version of the framework to the use the full 1.0 version. Part of this process involved deleting all the unused code-behind files associated with the view pages. However, since I've done this, whenever I open an .aspx or .ascx in Visual Studio, I get hundreds ...

How do I grab maxInvalidPasswordAttempts from web.config?

Hi I needed to rewrite lots of asp.net membership stuff since it did not meet my needs. So in my custom verify method I check their passwords if it fails. I grab the aspnet_membership maxInvalidPasswordAttempts column and add 1 to it. So in my web.config I set it to 10. So I want to grab the value from the web.config and compare to wh...

Can I share a view in asp.net mvc?

My controller has 2 actions: Results() Index() I want to share the view named index.aspx between these 2 actions. See my previous post for more information When I build my link to the page, I assume I cannot send it to Index action as it is expecting a FormCollection type and hence I create a Results action public ActionResult R...

ASP.NET MVC - Reusing Action Behaviors

This question pertains primarily to good design. Suppose I have a controller action like DeletePage that can be invoked in two separate views of the same controller. Assuming the delete logic is not contained in the action itself, but rather some conditional checks and the like that call the correct business logic, it doesn't make sense...

Integrating 2 different user dbs into a single ASP.NET MVC membersip provider?

I'm working on a project that needs to authenticate users based on records in two different databases. All administrators are stored locally and require full functionality to manage their accounts (reset password, etc). Regular users are authenticated against a different database used by another web app, so I only need to check that th...

Where is HttpRequestBase?

My solution (which is a copy of another one) is reporting an error because it cannot find HttpRequestBase. My code has references to system.web and system.web.mvc. Does this class still exist in MVC 1.0? ...

Injecting ISession Into My Repositories Using Structuremap in a Asp.Net MVC Application

My repositories all take ISession in the constructor: protected Repository(ISession session) { this.session = session; } private readonly ISession session; In an Asp.Net MVC application, using StructureMap, how would I go about setting up ISession in my the StructureMap Registry? Would I need to to add SessionFactory to the conta...

How do I send deep JSON objects to an Action?

In my web app I have a dynamically generated form that I use to create a JSON object to pitch back to an Action. As seen here: function getConfigItemWithValidators() { log.info("getConfigItemWithValidators()"); var oConfigItem = { "Name": $("#txtName").html(), "InputFileCellIndex": $("#inpFi...

ReturnUrl and preserve scroll position?

How do I indicate position on page in returnUrl? returnUrl= HttpContext.Current.Request.RawUrl ...

Can a PartialView re-render without a postback?

-- Running within ASP.NET MVC alongside jQuery -- I'm using jQuery to render a <LI> block as a list of dropdown menu items. There are 3 items in that list if the user is _not logged in - 4 items if he _has logged in. That 4th item needs to run a couple conditionals before it can decide exactly what payload it carries so I have that cod...

MVC Coolite ExtJS uploader issue

Hey guys, I have a question regarding the latest version of Coolite which utilizes (2.2.1). I have implemented the FileUploader in two places of my site and one section it works and the other it doesn't. I tried to diagnose it and I can't figure out the issue. Have any of you came across it and solved it at all? It would be very helpfu...

Populating ASP.NET MVC DropDownList

OK, I've been Googling for hours and trying everything and can't get anything to work. I am learning MVC using Sharp Architecture and have generated some basic forms for creating Client objects. I want to fill the state drop down list with a list of US states and let the user pick from that list. I am able to populate the list and get th...

Returning both status and HTML from Ajax Post in ASP.NET MVC

I'm rendering a page where part of the page is a FORM -- rendered via a partial. The submit button on that form posts to my controller via Ajax (using JQuery .post()). When the controller action takes over there are two possible execution paths: The form data is valid. In this case the controller updates the database with a new reco...

Minimalist approach to Error Handling

Would like suggestions on quick and easy error handling for asp.net mvc web application. ...

How to debug a published Asp.net MVC website from hosting internet server?

I just applied one account from asphostcentral then upload published asp.net mvc application on to that server, but i got an 500 errors, my application is KIGG. I just want to know how can I figure out how can I view errors in detail? ...

How do I manually set a user's role in ASP.NET MVC?

This project I'm working on requires me to keep a local db of admin users and use an external db for regular users. Anyone who passes authentication in the admin db should be assigned the 'admin' role, and anyone authenticated through the other db will always be assigned a 'user' role. Can I manually assign these roles? I don't need t...