asp.net-ajax

Why doesn't Ajax.BeginForm work in Chrome?

烂漫一生 提交于 2019-12-04 16:44:24
问题 I'm working with c#.NET MVC2 and I'm trying to create an ajax form that calls a method that deletes a database record (RemoveRelation). The process of deleting the record is working as intended. After the record is deleted the form should call a javascript function that removes the record from the visuals (RemoveRelation(10)). This is done through an AJAX call that on Internet Explorer 9 and Firefox 4 are all working as intended however on Chrome for some reason the update is not happening

Page losing title after UpdatePanel asyncpostback

故事扮演 提交于 2019-12-04 16:41:10
问题 I have just noticed recently that my page title will reset to the standard "Untitled Page" after I perform an asyncpostback from inside my UpdatePanel in the main page. The title will not be lost during a postback from inside the master page (such as when I click on the search box button inside the master page). I assumed that by using a different contentplaceholder specifically for setting the document title I was going to avoid issues like this, but apparently I was wrong. Is there

ASP.NET MVC jQuery autocomplete with url.action helper in a script included in a page

穿精又带淫゛_ 提交于 2019-12-04 15:40:28
I have been building my first ASP.NET MVC web app. I have been using the jQuery autocomplete widget in a number of places like this: <head> $("#model").autocomplete({ source: '<%= Url.Action("Model", "AutoComplete") %>' }); </head> The thing is I have this jQuery code in a number of different places through my web app. So i thought I would create a seperate javascript script (script.js) where I could put this code and then just include it in the master page. Then i can put all these repeated pieces of code in that script and just call them where I need too. So I did this. My code is shown

Submit Ajax.BeginForm via ActionLink

心不动则不痛 提交于 2019-12-04 15:35:18
I am trying to submit an Ajax.BeginForm using an hyperlink as opposed to a Submit Button. I tested with the submit button and the action recognizes the post as Ajax based by test Request.IsAjaxRequest, however if I try the following IsAjaxRequest returns false: <a href="javascript:void(0)" onclick="javascript:document.forms[0].submit(); return false;">Update</a> The form is hooked into Microsoft's Ajax library, so you can't just call form.submit() because the wired up ajax events aren't activated. You have a few options: Use a submit button instead of a link Drop the MS Ajax stuff and manually

How do you use ScriptManagerProxy in a custom ASP.NET control?

不羁的心 提交于 2019-12-04 14:51:44
Basically, I have created a custom control that uses an UpdatePanel, and as I understand it I need to use a ScriptManagerProxy to make it work ( since there should only be one ScriptManager per page, and is is declared in my .aspx page ).So, how do you use this beastie, is it just a matter of adding: <asp:ScriptManagerProxy ID="ScriptManagerProxy3" runat="server"> </asp:ScriptManagerProxy> to your control, or is there more to it? Could anyone please post a link to a good tutorial/example set? I tried googling for this, but I didn't find anything useful... Rob Windsor Your control does not

Refresh of GridView after UpdateMethod in UpdatePanel

自古美人都是妖i 提交于 2019-12-04 14:45:29
I have setup a GridView inside an UpdatePanel. The GridView has a SELECT CommandField that is tied to Gridview1_SelectedIndexChanged method. I would like the GridView to refresh after a row is selected but it never does. I have tried several different scenarios and none seem to work. I have set UpdateMode to "Conditional" and "Always" on the UpdatePanel and tried to force an update to the UpdatePanel in the code behind. I have converted the CommandField to a templatefield with a button Here is the sanitized code: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp

Strange ASP.NET error !

混江龙づ霸主 提交于 2019-12-04 14:44:46
I'm running Windows 7 - x64 Edition with IIS 7.5 I have a simple asp.net website that i've run on other versions of windows and IIS but now, on SOME pages it gives me the following error Exception information: Exception type: HttpParseException Exception message: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Stack trace: at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI

How can I get an UpdatePanel to intercept a CompositeControl's DropDownList

末鹿安然 提交于 2019-12-04 14:42:03
问题 I have a CompositeControl that contains a DropDownList. I have set the AutoPostBack property of the DropDownList to true. On the page, I have: <asp:UpdatePanel ID="UpdatePanel" runat="server"> <ContentTemplate> <MyControl:Control ID="CustomControl" runat="server" /> </ContentTemplate> </asp:UpdatePanel> I've also tried setting ChildrenAsTriggers="true" and UpdateMode="Always," but neither resolved the problem. The problem is that the UpdatePanel is not intercepting the CompositeControl's

How can I update a ASP.NET MVC ViewData via jQuery ajax?

情到浓时终转凉″ 提交于 2019-12-04 14:08:35
问题 I have a page that highly depends on a IList (in ActionResult "MyEvents") that I pass in ViewData. Something like that: ViewData["events"] = listOfEvents; and in the end, I just return View(); And in my View, I take this ViewData["events"] and do a foreach in it so I can iterate through its contents. But, this ViewData must be dynamically filled. So, when I click on a day (I'm using jQuery DatePicker), this day is sent as an argument to "MyEvents" and this day will be very important to my

Web API Post parameters are always Null

空扰寡人 提交于 2019-12-04 13:49:37
did anybody find a proper resolution of this? I just tried with WebAPI in big hopes (after completing a successful implementation of rest api in php/restler with KO and HTML5). Get is working like charm. Got stuck in post for last 20+ hours as no matter what always my variable is null. I do have DTO and repository implementation which is part of my framework anyway. I tried with FromBody hint and pretty much everything available in my search. I am testing this using CRest and Fiddler. I am even fine with getting raw request.content and then will deal with json loading etc by myself. This point