asp.net-mvc

Is ASP.Net State Server an elegant solution?

We have an ASP.Net MVC project that will start with a single web server but will likely soon scale into a small web farm. As ASP.Net Authentication stores a UserID, and data caching may also be useful, we will likely need to make the jump to state server fairly soon. I'd like to hear from others how State Server has been to work with...

Can you specify if aspnet_compiler.exe creates a debug or release build?

I wish to compile my asp.net MVC application using aspnet_compiler.exe from the comandline to speed up cold startup. I'm wondering how it determines if it should do a release or debug build. Is it always release? Does it depend on what the web.config file says when you run aspnet_compiler.exe? What happens to an application that's been...

How do I get certain code to execute before every single controller action in ASP.NET MVC 2?

I want to check some things about the state of the session, the user agent, etc, and possibly take action and return a special view BEFORE a controller method gets a chance to execute. For example: Most common: User requests Home/Index System checks to make sure x != 0. x does not equal zero, so the Home/Index controller executes like n...

asp.net mvc cookies not being sent back

My application at mysubdomain.mydomain.com needs to set a cookie that contains some user session information. They log in at a https page. We authenticate them and set some session info in a cookie. We do this in a helper library that takes in the controller context contextBase.Response.Cookies[CookiePayload.CookieName].Value = encry...

logic of button to be disabled or not in mvc

Hi All, Here's an excerpt from a book I'm reading about application design with MVC: Ideally, the view is so simple and logic-free as to need virtually no testing. Users (and developers before users) can reasonably test the view by simply looking at the pixels on the screen. Anything else beyond pure graphical renderin...

ValueProvider.GetValue Extension Method

I have a model like this; public class QuickQuote { [Required] public Enumerations.AUSTRALIA_STATES state { get; set; } [Required] public Enumerations.FAMILY_TYPE familyType { get; set; } As you can see the two proerties are enumerations. Now I want to employ my own model binder for reasons that I won't bother getti...

Can we run ASP.NET MVC 2.0 on .Net 2.0?

I have an asp.net website which is already developed in .net 3.5, Now I asked to develop few pages in MVC 2.0 and few pages in DynamicData. Now Can I Run the ASP.NET MVC 2.0 and Dynamic Data in 3.5. When I run this i am getting lot of errors in web.config. ...

What does the new <%: %> encoding syntax in Visual Studio 2010 do?

Hi, Scott Hanselman's latest blog entry about the new VS 2010 features mentions "the new <%: %> encoding syntax". What does it do? Searching for these tags with google doesn't seem to be possible... Thanks, Adrian ...

ASP.NET MVC Html.ActionLink Maintains Route Values

Hi, I have a question that has pretty much been asked here: http://stackoverflow.com/questions/780643/asp-net-mvc-html-actionlink-keeping-route-value-i-dont-want However, the final solution is a kludge, pure and simple and I really would like to understand why this happens, if someone can please explain it to me? For completeness, it...

MVC ActionLink generating NON-Restul URL AFTER adding constraints

Hello I have a custom route without constraints that generates a Restful URL with an ActionLink. Route - routes.MapRoute( "Blog", // Route name "Blog/{d}/{m}/{y}", // URL with parameters, new { controller = "Blog", action = "Retrieve" } Generates - http://localhost:2875/Blog/12/1/2010 From - <...

mvc action link error message

What is wrong with this statement? <%= Html.ActionLink("Assign Users", new { Controller="Users", Action="Index", Query="Index", Page=2932 })%> I`m having the following error: Error 10 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'ActionLink' and the best extension method overload 'System.Web.Mvc.Html.LinkExtens...

The given key was not present in the dictionary.

i found an error whenever i am calling oracale stordeprocedure from class using isession this is my mappping file <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="field" assembly="DataContext" namespace="DataContext" > <sql-query name="GetEmployeedetails" callable="true"> <return alias="emp" class="empdeta...

Inserting Multiple Records in SQL2000

I have a web app that currently is inserting x (between 1 + 40) records into a table that contains about 5 fields, via a linq-2-sql-stored procedure in a loop. Would it be better to manually write the SQL Inserts to say a string builder and run them against the database when the loops completed rather than 30 transactions? or should I j...

Web based weekly planner

Hello I'm looking to implement a web based weekly planner where a user can set when they will be unavailable to work. The state of the week will be saved as a 'varbinary' with a length of 168 which will represent every hour of everyday of a week. The database only needs to store the value of one week as the times unavailable to work wil...

Help System.Web.Compilation.BuildManager find a type in a non-referenced assembly

I'm trying to write a plug-in system where assemblies can be dropped in a folder that ASP.NET has no knowledge about. This plug-in system works fine for ASP.NET MVC based assemblies, but for old-school WebForm assemblies (where the .aspx files Inherits the System.Web.UI.Page derived classes) System.Web.Compilation.BuildManager is respons...

Cleaning tag soup from the View in ASP.Net MVC

I want to remove if-statements from my View, but I'm having problems with predefined controls like Html.DropDownList. For example, I have an DropDownList that in some case contains empty selection (or in other words.. possibility to Not select something) and other case is that there is no empty selection. <% if (Model.IsCreateEmptySel...

asp.net MVC Multi-tenancy: Is there a way to override/influence User.Identity.IsAuthenticated?

I have a custom memebership provider that has served us well for asp.net web forms applications and am now using it in a new asp.net MVC multi-tenancy application. The membership provider works well in MVC, just as within webforms, but now want to add an additional constraint where we can check if a User is both authenticated and authen...

ASP.NET MVC 2 loading partial view using jQuery - no client side validation

I am using jQuery.load() to render a partial view. This part looks like this: $('#sizeAddHolder').load( '/MyController/MyAction', function () { ... }); The code for actions in my controller is the following: public ActionResult MyAction(byte id) { var model = new MyModel { ObjectPro...

C# mvc2 client side form validation with xval, prevent post

I'm using xval to use client side validation in my asp.net mvc2 web-application. Despite the errors it's giving when I enter text in a numeric field, it still tries to post the form to the database. The incorrect values are being replaced by 0 and saved to the database. But instead it shouldn't even be possible to try and submit the form...

ASP.NET MVC DisplayAttribute and interfaces

I have some interface and classes public inteface IRole { int Id { get; } string Name { get; set; } } public class Role : IRole { public int Id { get; } [Display("Role Name")] public string Name { get; set; } } public class Member { [Display("Login")] public string Login { get; set; } [Display("Password")] public st...