asp.net-mvc-2

how to create sql WHERE clause from jqgrid multipleGroup filter condition in ASP .NET MVC2

[亡魂溺海] 提交于 2020-01-05 09:09:36
问题 jqGrid multiple group search is used which produces grouped filters object. ASP .NET MVC2 is used in server side to create where clause string which is passed to PostgreSql. Oleg ASP.NET MVC jqGrid sample sql where clause builder builds invalid where clause for this condition. It works only without gruping. Whre to find sample C# code which generates corrent where clause if multipleGroup: true is used ? $.extend($.jgrid.search, { savekey: [true, 13], multipleSearch: true, multipleGroup: true,

jquery.validate lost on ajax replacement and only showing last error

青春壹個敷衍的年華 提交于 2020-01-05 07:10:29
问题 I am using jquery.validate in MVC 2 with MicrosoftMvcJQueryValidation. I have data annotations on my model which is then being translated into jquery validators. I am using a modification to MicrosoftMvcJQueryValidation as outlined by Soe Tun to allow my error messages to appear in a validation summary instead of beside the controls. When the page loads, everything works as expected. The problem is that I am using ajax forms with replace mode to rewrite the form. When I do this, I lose all of

ASP.NET MVC - What is the best way to build a search form that works properly with SEO and users without JS?

对着背影说爱祢 提交于 2020-01-05 06:28:07
问题 I'm working on building a search engine in my application, and because I don't want to have a Querystring in my URL, I'm currently using Javascript to submit the searchTerms for me. Basically I am NOT using a "form", but rather just an input <input id="searchBox" class="search" name="searchTerm" tabindex="1" onfocus=" this.className = 'search-alt'; if (this.value=='search...') this.value = ''" type="text" onkeypress="searchKeyPress(event,this.form)" maxlength="80" size="28" value="search...">

ASP.NET impersonation problem

假如想象 提交于 2020-01-05 04:57:27
问题 I am trying to get my IIS 7.5 to impersonate the account of the user accessing a site through a browser. If I use... <identity impersonate="true" userName="mydomain\myusername" password="mypassword" /> it works just fine. However, if I use... <identity impersonate="true" /> It won't pick up the user. Am I missing some code? Or is this an IIS 7.5 configuration issue? 回答1: I posted a previous answer, but I think this one applies better Try to select if you are using a specific user or pass

Lose Focus from Select Box with Jquery .change() event

送分小仙女□ 提交于 2020-01-05 04:12:10
问题 I am using a dropdown which displays several form fields after you choose something from the dropdown. I have bound the dropdown with jquery to detect a change, however, the box must 'lose focus' before the .change is triggered. Any way to fix this? $("#EmployeeSelected").change(function () { alert('hi'); }); 回答1: It doesn't appear to require losing focus, at least with an traditional change. If you are using another form of changing, ie keystrokes, you may want to consider binding additional

ASP.NET MVC2: Update of a model for further modifications in a POST handler.

泄露秘密 提交于 2020-01-05 04:06:12
问题 Model: public class Model { public ItemType Type { get; set; } public int Value { get; set; } } public enum ItemType { Type1, Type2 } Controller: public ActionResult Edit() { return View(new Model()); } [HttpPost] public ActionResult Edit(Model model, bool typeChanged = false) { if (typeChanged) { model.Value = 0; // I need to update model here and pass for further editing return View(model); } return RedirectToAction("Index"); } And of course View: <div class="editor-label"><%: Html.LabelFor

What causes a 403 error on a local Azure development environment?

大兔子大兔子 提交于 2020-01-04 09:22:49
问题 I have an Azure application that works perfectly on every one of my colleagues machines. On mine, the web application works, but not the azure project, which runs on the local development fabric. I'm getting a 403 error, which causes a blank page in Chrome. The application_start method gets fired and sets up the routes, but the actual MVC controller never gets called. Again, this works perfect if I run the web application directly. If I use that same azure project and deploy it online, it

What causes a 403 error on a local Azure development environment?

瘦欲@ 提交于 2020-01-04 09:21:49
问题 I have an Azure application that works perfectly on every one of my colleagues machines. On mine, the web application works, but not the azure project, which runs on the local development fabric. I'm getting a 403 error, which causes a blank page in Chrome. The application_start method gets fired and sets up the routes, but the actual MVC controller never gets called. Again, this works perfect if I run the web application directly. If I use that same azure project and deploy it online, it

RedirectToAction for areas?

空扰寡人 提交于 2020-01-04 09:18:55
问题 I have setup some areas, but I'm not sure how to Redirect to them via the RedirectToAction method. There doesn't seem to be any Area parameter I can feed it. Thanks 回答1: You will need to use RedirectToRoute if you are trying to redirect to an ActionResult outside the current area. You will first want to make sure you have a route to the ActionResult you would like to redirect to registered for your area. The following article is helpful for this: http://msdn.microsoft.com/en-us/library

“null” values shown in form fields in IE

。_饼干妹妹 提交于 2020-01-04 07:04:14
问题 I use Html helpers to display model data in form fields, e.g. Html.TextBoxFor, Html.TextAreaFor. When the model values are null, I would expect the values should be empty in the form fields. They are displayed normally in Safari and Firefox, i.e. empty, but in IE, they are shown as "null" in a text field (see image below). Any clue how to fix this? Thanks. 回答1: Well, it turned out to be JavaScript's problem (with IE, that is). In the following statement, if value == null , IE would display