asp.net-ajax

FileUpload control inside an UpdatePanel without refreshing the whole page?

时间秒杀一切 提交于 2019-12-17 07:33:18
问题 According to Microsoft the FileUpload control is not compatible with an AJAX UpdatePanel. I am aware that a PostBackTrigger can be added to the submit button of the form like this: <Triggers> <asp:PostBackTrigger ControlID="Button1" /> </Triggers> The problem is that this forces the form to perform a full post-back which voids out the whole point of using the UpdatePanel in the first place. Is there a workaround to this issue that does not cause the whole page to refresh? 回答1: I know of a

How do I make a Textbox Postback on KeyUp?

╄→гoц情女王★ 提交于 2019-12-17 07:18:37
问题 I have a Textbox that changes the content of a dropdown in the OnTextChanged event. This event seems to fire when the textbox loses focus. How do I make this happen on the keypress or keyup event? Here is an example of my code <asp:TextBox ID="Code" runat="server" AutoPostBack="true" OnTextChanged="Code_TextChanged"> <asp:UpdatePanel ID="Update" runat="server"> <ContentTemplate> <asp:DropDownList runat="server" ID="DateList" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID

Function not defined error while using asp.net ajax

别等时光非礼了梦想. 提交于 2019-12-17 05:15:20
问题 i am trying to call a web service through asp.net ajax by the following code namespace MCTS70515AJAX { public static class HR { public static int GetEmployeeCount(string department) { int count = 0; switch (department) { case "Sales": count = 10; break; case "Engineering": count = 28; break; case "Marketing": count = 44; break; case "HR": count = 7; break; default: break; } return count; } } this is the aspx page i am rendering <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AJAX2

How to send a model in jQuery $.ajax() post request to MVC controller method

家住魔仙堡 提交于 2019-12-17 04:22:41
问题 In doing an auto-refresh using the following code, I assumed that when I do a post, the model will automatically sent to the controller: $.ajax({ url: '<%=Url.Action("ModelPage")%>', type: "POST", //data: ?????? success: function(result) { $("div#updatePane").html(result); }, complete: function() { $('form').onsubmit({ preventDefault: function() { } }); } }); Every time there is a post, I need to increment the value attribute in the model: public ActionResult Modelpage(MyModel model) { model

Sys.ArgumentUndefinedException: Value cannot be undefined

拈花ヽ惹草 提交于 2019-12-14 03:56:37
问题 I am developing some ajax stuff on asp.net mvc framework beta. but,I got exception as following. Anyone has problem like me? Sys.ArgumentUndefinedException: Value cannot be undefined. and my source code is like this. <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script> <script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script> <script src="../../Scripts

Using ASP.NET PageMethods with JQuery DataTables?

老子叫甜甜 提交于 2019-12-14 03:05:40
问题 For starters, I'm new to ASP.NET Ajax stuff, and only getting back into JQuery after a long hiatus, so excuse any stupid sounding parts of this question :) I would like to use the DataTable plug-in for JQuery in my ASP.NET page. Additionally, I'd like to do server-side pagination. It seems like in order to do that, I would have to create a web service and provide the url of said service to the "sAjaxSource" property of the DataTable. I'm just now discovering "PageMethods", which appear to be

Calling multiple __doPostBack from JavaScript

我与影子孤独终老i 提交于 2019-12-13 20:32:48
问题 I've got multiple UpdatePanel's on a page and i'm updating 2 of them manually by calling __doPostBack. However the problem is the first call seems to be reset when the second call is made (it never updates the panel that i requested to update first). I've got these calls wrapped in setTimeout, but it does not seem to help. Any suggestions on how to make both calls work? 回答1: You could probably do this on the server side of things: UpdatePanel1.Update(); UpdatePanel2.Update(); This causes the

Cannot get @Ajax.ActionLink to work in a partial view, get “Cannot resolve” error

回眸只為那壹抹淺笑 提交于 2019-12-13 19:44:29
问题 I am using MVC3, ASP.NET 4.5, C#, Razor. I have successfully got the Ajax.ActionLink working from my main page which contains a table and records with each containing a link. The Ajax.ActionLink "replaces" the record in all cells within the element. I use a partial view to do this replacing in: <td>col1</td><td>col2</td> However col1 should retain the Ajax.Actionlink as it will be required again, so my partial view should be: <td>@Ajax.ActionLink("Delete",...)</td><td>col2</td> But I get a

Changing a user created control based on content of input from JS tied textbox

主宰稳场 提交于 2019-12-13 18:18:55
问题 I want to change a user created control based on content of the input inside of textbox tied to JS. My user control has an attribute field titled "userInput" where I pass the content of the textbox. My page looks like this: The textbox has an autocompleteextender and a Javascript function runs when an item from the dropdown is selected. How do I pass the selected value back to the server so that my ascx user control can be updated with the appropriate data. (corresponding to what is in the

JQuery not working

旧时模样 提交于 2019-12-13 17:41:18
问题 I am trying to implement JQuery in my web page but i am not been able to implement it successfully. I have a master page where i added one script for menu bar that is already using jquery hosted by Google This is coded in master page itself <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script> Now i want to implement a Jquery to set the css visibility property to true or false. into my content page of same master page. <script type=