asp.net-mvc-2

404 Error When Caching .aspx Pages With HTML5 Cache Manifest

偶尔善良 提交于 2020-01-03 04:35:14
问题 Has anyone been able to cache .aspx pages using the HTML cache manifest? I am porting an html application over to asp.net (and mvc2) and I get a 404 error when trying to cache any *.aspx page. Other files still cache normally (.js, .css, etc). I have changed permissions, handlers, and file names and still no luck. Below is the actual manifest: CACHE MANIFEST # This file was generated at 2/28/2011 4:03 PM CACHE: /Content/Site.css /Content/Table_style.css /Scripts/jquery-1.5.min.js /Scripts

SelectList to filter results based on sql tables bool column for “Retired”

孤人 提交于 2020-01-03 03:44:08
问题 I have a selectlist which I've setup in a ViewModel and DropDownFor and it already has itself ordered as u can see below but I need it to filter so that the 3rd column "Retired" if it's value is "0" all those results are show but not if it's "1". I was thinking I would need to add after the .OrderBy(...).Where(m=>m.Retired but don't know how exactly I'd filter it from there and ofc it doesn't have to be done in the VM but that's just how I was able to implement the OrderBy filter. VM List

Stored procedure or LINQ? [closed]

左心房为你撑大大i 提交于 2020-01-03 03:24:08
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I have a webshop created in ASP.net MVC 2 with a database SQL server. If I need to make filtration for instance specfic products from the stock in database via webshop. Which options should I choose and why? Make the filtration via stored procedure? Using LINQ as a C-sharp

MVC3 HTML helper doesn't update DropdownListFor on Submit the form

人走茶凉 提交于 2020-01-03 03:11:33
问题 I have a simple HTML form with dropdwonListFor bound to colors, a textBox below it and submit button to submit the form and save the color. When I select a color from the dropdownlist, it will change the value of the textbox below it, if the user clicks the submit form. it goes back to the controller and I save the color from the texebox and return view(model) as an action result, but the problem that the dropdownlistfor doesn't get updated with the value of the textbox whether the value in

step by step problem with validation on “back” button

坚强是说给别人听的谎言 提交于 2020-01-02 20:03:27
问题 I have a 3 steps forms where I bind for each step on a ViewModel that has DataAnnotation. Everything works fine except that when I click on my "previous" button, the validation gets called and, if there's missing values, the user has to fill all required fields. If I go with an action link, then the data won't be persisted. What I'm looking for here is a way to save my values without calling the validation. I also consider using cookies but I don't think that it's the best way of doing it.

ASp.NET MVC EF4 SQL Table or Field level security

空扰寡人 提交于 2020-01-02 13:55:55
问题 I have an slightly unusual security requirement, and I'm looking for advice on best practice, or at-least non-brittle approaches. Scenario: Intranet system. Data about a number of related entities is to be considered as private. This is known as the unpublished part of the system. Only certain users can access this data. At some stage the users make a selection from this data, mark some records and publish them to the "published" side. The data published to the published side is removed from

How to get interpolated message in NHibernate.Validator

 ̄綄美尐妖づ 提交于 2020-01-02 12:14:15
问题 I'm trying to integrate NHibernate.Validator with ASP.NET MVC client side validations, and the only problem I found is that I simply can't convert the non-interpolated message to a human-readable one. I thought this would be an easy task, but turned out to be the hardest part of the client-side validation. The main problem is that because it's not server-side, I actually only need the validation attributes that are being used, and I don't actually have an instance or anything else at hand.

Can I pass the viewbag value to the jQuery in mvc2

岁酱吖の 提交于 2020-01-02 10:33:55
问题 I need to pass the value to jQuery in the view using viewbag. What I want to achieve is pass the null or some value and then jQuery should hide or show the div depending on the value passed for instance something like below: viewbag.testNumber = null; $('#showdiv').hide(); $('viewbag.testNumber').value == someinteger{ $("#showdiv").show(); else $("#showdiv").hide(); }); <div id="showdiv"> Some Calculation </div> Also I want to disable the viewbag in the view if the value is null , because it

Visual Studio 2010 - web deploy times out - what to do?

纵然是瞬间 提交于 2020-01-02 10:22:14
问题 My MVC2 web project is deployed using the VS 2010 "web deploy" feature. It used to run fine but now it is timing out more often than not with this error message: Web deployment task failed.((10/11/2010 1:01:59 a.m.) An error occurred when the request was processed on the remote computer.) (10/11/2010 1:01:59 a.m.) An error occurred when the request was processed on the remote computer. The remote host closed the connection. The error code is 0x800704CD. Searching for the error code 0x800704CD

Sending xml to an ASP.NET MVC Action Method Argument

早过忘川 提交于 2020-01-02 10:15:44
问题 Is it possible to send POX (plain old xml) into an action and have that action perform model binding to an object for you. Have seen this done with JSON but dont see anyone doing this with xml. 回答1: Looking at doing a similar thing, but with JSON. I think you could also use a ActionFilterAttribute for this purpose. An example is shown here. 回答2: You can achieve this by creating your own model binders. you can get idea from the following links. http://odetocode.com/blogs/scott/archive/2009/04