asp.net-mvc

will asp.net mvc model binder keep a posted array in the proper order?

Hello, so i've got an array of numbers that i'm posting to an asp.net mvc action that has a list(of integer) parameter and it all works great. my question is this: Is it safe to assume that the list(of integer) will have the numbers in the same order as they were in the array i posted? Thanks for your time! EDIT: The data being ...

How do I set the Cancel property inside OnActionExecuting

I've created a sub class of ActionFilterAttribute and I want to set the Cancel property. It's not a member of the base class, it's not a member of the ActionExecutingContext, so where is it? Thanks ...

How Do I Not Allow Any Firefox Customizations of my web application?

I have built an ASP.NET mvc web application and it seems that some of our users have started making add-ons or extenstions of some type in Firefox to customize the app for them specifically. Is there any way to not allow this? Can I do something with my app so they have no access to run customizations? My boss is freaking out over thi...

ASP.NET MVC 2 Validating A Strongly Typed Model List With Data Annotations Exception When Using EnableClientValidation()

Here is the buddy class used to add data annotation validators to a Entity Framework model: [MetadataType(typeof(Result_Validation))] public partial class Result { } [Bind(Include = "Title,Description")] public class Result_Validation { [Required(ErrorMessage = "Title is required")] public string Title { get; set; } [Requ...

patterns to use when building complex web UI

I need to implement a wizardy, dynamic UI that uses complex validation of the style: If A = 1, show controls B, C, D. B is required, C is not, and D is not required must be less than 30 if it is populated. If A = 2, show controls B, D, E. B is not required, D is required but has no limits, and E is not required. If B is not null, show ...

Need advice for good free-download WYSIWYG text editor for website in ASP.NET MVC

Hello, What's a good WYSIWYG text editor for ASP.NET MVC, with possibility to add pictures, I can download for free to use in my application so that those who are not developers can add content to the website. By good ones, I mean those which can be used without to many configuration, simple ones. Some people might point out that this ...

Should I learn SharePoint 2010 or SharePoint 2007?

In other words : currently it's easier to get job with SharePoint 2007, but when I learn 2010 will I be able to use older version from only 2010 knowledge ? I don't know any SharePoint yet. And what should I know before I start with SharePoint? Is C# and ASP.NET (MVC) enough ? ...

Is ADO.NET Entity Framework (with ASP.NET MVC v2) a viable option when writing custom and contantly updated websites?

Hello SO, I've just finished going through the MvcMusicStore tutorial found here. It's an excellent tutorial with working source code. One of my favorite MVC v2 tutorials so far. That tutorial is my first introduction to using ADO.NET Entity Framework and I must admit that most of it was really quick and straight-forward. However, I am...

Redirect site from www.a.com to a.com in asp.net mvc

We have asp.net mvc 2 site which allows www and without any subdomain. For consistency we want to redirect any www request to without any subdomain. Just like stackoverflow does. Where and how it should be done? using asp.net Requestrouting? Also i want it for all request to the site not just for home ...

AntiXss and my desired results

After scrubbing my field with AntiXss.HtmlEncode is there a way to remove all the html elements because they still show up as literals in the display? ...

Retrieive ids from the checked checbox itens in a GridView Row

Hello guys, I need present a grid-view in the web page, and based on the checkbox that each grid row has I want to retrieve and submit a value of the ID of each grid column. I'm using asp.net mvc and the mvc contrib grid, but accept suggestions on how to do via JQuery or Javascript too. Thanks. ...

How to disable VS compile warning "class or css class is not defined"

In VS 2008, when I compile, I get a large series of The class or CssClass value is not defined messages. How do I get the error/warning code (something like "C0167") for that message, so I can disable it? Answers that won't work: The compiler gives you the warning number. No, it doesn't. See the list of MSDN compiler errors (found a...

Is it a good idea to extract controller logic into a service that extends repository functionality

Hi, I had a controller POST action that is called List that accepts a status variable which can be the following values { "all", "active", "inactive}. Then I made repository calls based on the the value of "status" inside of the controller. The controller looked like this: [HttpPost] public ActionResult List(string status) ...

ASP.NET MVC JsonResult return 500

Hi I have this controller method: public JsonResult List(int number) { var list = new Dictionary<int, string>(); list.Add(1, "one"); list.Add(2, "two"); list.Add(3, "three"); var q = (from h in list where h.Key == number select new ...

using Jquery to find out what check boxes are checked

I have a table that i am enumerating through my model with. I have this check box there for each row. <input type="checkbox" name="IsSelected" value="<%=item.PartNo%>" /> I would like to use jquery to find out which of the check boxes are checked I tried doing this var selected = $("#IsSelected").val(); but selected is just un...

ASP.NET MVC Display Format does not format DateTime to just Date string.

I've got my display format setup as so <DisplayName("birthdate")> _ <DisplayFormat(ApplyFormatInEditMode:=True, DataFormatString:="{0:MM/dd/yyyy}")> _ Public Property BirthDate As DateTime Then in the View I have the following <%: Html.TextBoxFor(Function(model) model.BirthDate, Model.BirthDate)%> <%: Html.ValidationMessageFor(Functi...

ASP.NET Validation not firing even when my form is obviously invalid.

I've got the following View <% Using Html.BeginForm()%> <%: Html.ValidationSummary(True) %> <div class="displayright"> <h3> <%: Html.LabelFor(Function(model) model.About) %></h3> <noscript> <h3> Please use <%: Html.ActionLink("Markdown", "Markdow...

Post/Redirect/Get in Webkit causes a full page reload

It seems that in Webkit-based browsers (Chrome and Safari) when a Post/Redirect/Get is performed on the server, the entire page (html + images + css, etc.) is redownloaded. It appears the same as if you reloaded the page. There's been a question (and somewhat of a solution) posted in the Google Chrome Help: http://www.google.com/support...

What's with "The following line works around an ASP.NET compiler warning" in MVC Views?

I did a quick search on SO for this and didn't come up with anything. Doesn't <%-- The following line works around an ASP.NET compiler warning --%> <%: ""%> seem like a bit of a hack? what's the point of this, and is the MS Dev Team doing anything to work towards a resolve? ...

How to authorize an OpenID user on MVC Controller

I'm looking at the [Authorize(Roles = "DefaultUser")] available in MVC, but I can't seem to figure out if I can use it with DotNetOpenAuth. I'm using OpenID as my sole membership provider, but I have a few generic items in a UserProfile table. I don't want anyone except the appropriate user to be able to access the edit controller. EX...