asp.net-mvc

Asp.Net MVC - Change error class name

When I do field validation in Asp.Net MVC, it's generated the following error css classes : input-validation-error field-validation-error Is there a way that the error class generated have a different names ? I use xVal. ...

.NET MVC Localization (resourceprovider) implementation not working correctly

Hi, i'm currently implementing a localized website. I've created a custom ResourceProvider + Factory for storing resources in a database. This all works, i'm storing data as follows: resourceid | url (null) | type (null) | name | culture (null) | value 1 | NULL | Common | Test ...

MVC: Model missing data in partial view

I'm using the Telerik PanelBar to do some asynchronous loading using a partial view. I'm creating a model for the partial view in a parent view, but for some reason my data isn't coming through in tact. // Parent view <% Html.Telerik().PanelBar().Name("PanelBar").HtmlAttributes(new { style = "padding-left: 0em;" }).Items(items => { ...

MVC Dropdown List

I have a dropdownlist : <%=Html.DropDownList("memberInvoiceStatus", ViewData["memberInvoiceStatus"] as SelectList)%> Can I set the default value in the view? I am binding like this... IEnumerable<PayStatus> memberInvoiceStatus = new List<PayStatus>(dr.GetPayStatus()); ViewData["memberInvoiceStatus"] = new SelectList(memberInvoiceSt...

is there anyway to dynamically create an image with embedded hyperlinks

i am created images on the fly in my controller (bitmaps, pngs, gif) and sending them down to the view. Is there anyway to embed hyperlinks into an image ? ...

Caching account information

I currently using my own membership implementation on a ASP.MVC project. I've got an Account and an Account can have more than 1 memberships. I am not sure what is the best approach to follow with Account information being cached. I am currently loading the account information for almost each request from the User property of the contr...

Rendering form from get call using jquery and asp.net mvc

I have an action that returns a partial view. The views is a table and each row if another partial view. Each row contains a form for submitting settings for a piece of hardware. After submitting the form I would like to make sure the forms so the correct state of the hardware so I do a get for the action and replace the HTML with the...

Is there a way to make MVC.NET routing ignore a few /dir/paths/ ?

Meaning I could have the URL routing start at like site.com/v3/site/controller/action basically it would ignore the v3/site/ and treat that as root? ...

Do Virtual Directories in shared hosting conflict with stuff in wwwroot?

Hi I have an asp.net mvc application, phpBB forum and asp.net webservice that I want them all in the same wwwroot. My shared hosting allows virtual directories so I went a head and made one. It made the directory and some web.config in it. I then uploaded my asp.net webservice and overrode the web.config that was in virtual directory ...

Adding to ViewData[] collection from AuthorizeAttribute Extension

I wrote an extension class to customize my AuthorizeAttribute for my action methods and I'd like to be able to inject messages into my view when a certain condition is met. I"m using the below code to load up a shared view when a user is not authorized but it's not adding my message to my ViewData collection. Any ideas? public overrid...

Why do Strongly Typed Html Helpers help me?

I read ScottGu's explanation on Strongly Typed Html Helpers and I understand that it gives me the ability to do better compile time checking of views. I was under the impression that I already had this when I used the model.PropertyName in the MVC1 Html.TextBox helper, but apparently that is not true. So, how does using a lambda expres...

Trouble setting a default controller in MVC 2 RC Area

This should be simple, but alas... I've set up an Admin area within my MVC 2 project (single project areas). I've created a couple controllers and their respective view folders. In the AreaRegistration.RegisterArea method, I've specified that I want the default controller to be "Dashboard": public override void RegisterArea(AreaRegis...

Determine if user can access database generated page?

I have Membership, Profile and Role providers setup for my .NET MVC website. I would like to say: this Role has access to that Page. How do I 'inject' this code to the RoleProvider? Or do I have to override it somehow? Any leads? (Roles are stored in the default ASP.NET SqlRoleProvider, Pages are stored in a seperate SQL database). ...

Using Async Controller in ASP.MVC Future Assembly

Microsoft has included the AsyncController to the latest beta version of the Mvc framework. I'm currently working on a project where we have to use Asp.net MVC v1.0. There is a long-running process in the application (large file upload, some processing and then saving a large amount of data in the database). I have found some tutorials ...

[NHibernate and ASP.NET MVC] How can I implement a robust session-per-request pattern in my project, while focusing on information hiding?

I'm currently building an ASP.NET MVC project, with NHibernate as its persistance layer. For now, some functionnalities have been implemented, but only use local NHibernate sessions: each method that accessed the database (read or write) needs to instanciate its own NHibernate session, with the "using()" directive. The problem is that ...

ASP.NET MVC: DataAnnotations - Show an error message indicating that a field must be numeric

There appears to be something of a hole in the way DataAnnotations works in that a user entering in some text into a field that will go into an int will never reach the DataAnnotations code. It kicks off a model binding error and displays the error to the user "The value 'a' is not valid for the XXXX field." Anyway, it's all very nice t...

Modify a model in an ActionFilter

Hello, I have an actionfilter that I am running OnActionExecuting in ASP.NET MVC 2. Essentially I would like the actionfilter to sanitize my data and replace the current model (which will be passed to subsequent action filters and also my action method) with the sanitized model. Is this possible and is it a bad idea - if so why? Thank y...

rails style database migrations for asp.net?

I am in love with the rails style of updating db schema. I can define a migration as a class with fairly simple, yet powerful syntax. I can run the updates with a single command and all of my models are updated. They are committed to source control and can be easily read, modified, and undone. My current way of doing it for my asp.net m...

RedirectToAction Not Loading Correct View

Hello, This is a weird one. Probably painfully obvious. :D I have a View (let's call it View0.aspx) that posts a form to a controller action (let's call it Action1). Action1 runs and then returns RedirectToAction("Action2"), which in turn returns View("View2"). Running it in the debugger, everything looks great (Action2 breakpoint gets...

Can Areas in an ASP.Net MVC 2 Application map to a subdomain?

Is there a way to map the Areas within an ASP.Net MVC 2 application to subdomains such as: movies.example.com/Theater/View/2 instead of example.com/Movies/Theater/View/2 (where { area = "Movies", controller = "Theater", action = "View", id = 2 } ) ...