asp.net-ajax

What's the difference between $get and $find in JavaScript?

给你一囗甜甜゛ 提交于 2019-11-28 08:04:51
I'm a .NET programmer who've just started to learn more about client side scripting, and I was wondering sometimes you use $get('value') and $find('value') and I've discovered that these are just shortcuts for document.getElementById('value') and Sys.Application.findComponent('value') , respectively. However, I still don't understand: what is the difference between these two functions in JavaScript? What exactly are they looking up/retrieving when invoked? Thanks in advance. brendan $get & $find are shortcut functions Microsoft has built into their Ajax JavaScript Library. $get is short for

$.post vs $.ajax

流过昼夜 提交于 2019-11-28 07:02:10
问题 I'm trying to use the $.post method to call a web service, I've got it working using the $.ajax method: $.ajax({ type: "POST", url: "StandardBag.aspx/RemoveProductFromStandardBag", data: "{'standardBagProductId': '" + standardBagProductId.trim() + "' }", success: function(){ $((".reload")).click(); }, dataType: "json", contentType: "application/json" }); But when I move the same method into the $.post method, it will not work: $.post("StandardBag.aspx/RemoveProductFromStandardBag", "{

Load partial view depending on dropdown selection in MVC3

笑着哭i 提交于 2019-11-28 06:32:01
Im trying to create a from using asp.net mvc3. I have a dropdownlist with some options. What i want is different partial views to be injected into the page, depending on the selection in the dropdown list. But. i dont want this to rely on a submit action. It should function so that, the partial view is loaded as soon as you select from the select list. I have this code: @using (Ajax.BeginForm("Create_AddEntity", new AjaxOptions { UpdateTargetId = "entity_attributes", InsertionMode = InsertionMode.Replace } )) { <div class="editor-label"> @Html.Label("Type") </div> <div class="editor-field">

LinkButton in ListView in UpdatePanel causes full postback

筅森魡賤 提交于 2019-11-28 05:49:29
I have a LinkButton in a ListView in an UpdatePanel. I would like the button (well, any of them) to cause a partial postback, but they are causing a full page postback. <asp:UpdatePanel ID="upOutcomes" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:ListView ID="lvTargets" runat="server" onitemdatabound="lvTargets_ItemDataBound"> <ItemTemplate> <asp:LinkButton ID="lnkAddTarget" CssClass="lo" Text='<%# Eval("Title") + " <b>" + Eval("Level") + Eval("SubLevel") + "</b>" %>' runat="server"></asp:LinkButton> </ItemTemplate> </asp:ListView> </ContentTemplate> </asp:UpdatePanel> I

Disable asp.net button after click to prevent double clicking

三世轮回 提交于 2019-11-28 05:41:46
I have an ASP.NET button that I need to disable after the user clicks it to prevent double-clicking. Once the submit completes it has to be enabled again. Can anyone help me with this? Here is a solution that works for the asp.net button object. On the front end, add these attributes to your asp:Button definition: <asp:Button ... OnClientClick="this.disabled=true;" UseSubmitBehavior="false" /> In the back end, in the click event handler method call, add this code to the end (preferably in a finally block) myButton.Enabled = true; gkneo I have found this , and it works: btnSave.Attributes.Add(

Pass data from a ASP.NET page to ASCX user controls loaded dynamically

霸气de小男生 提交于 2019-11-28 04:59:24
I'm developing an ASP.NET application with C# and Ajax. I have a page that holds user controls loaded dynamically. I need to pass some data (integer values and some strings) to the user control that has been loaded dynamically . Now I use Session to pass these values, but I think I can use another way; something like VIEWSTATE or hidden input. What do you recommend me? UPDATE: The fact that I load the controls dynamically is important because controls are loaded on every postback, and I can't store any value on controls. Create a property on your user control with the datatype of the data you

CrossPostback ,AJAX Controls and ASP.NET generated postbacks work for .NET 4.5 , not .NET 4.0 in IE 11

我的未来我决定 提交于 2019-11-28 04:09:45
问题 I had posted and answered the question earlier.WebResource.axd not working with Internet Explorer 11 But I thought the hotfix had fixed the issue(CrossPostback ,AJAX Controls and ASP.NET generated postbacks not working) but after installing in QA , it didn't work and we realized it was .NET 4.5 that made things work . I am under the process of comparing .NET frameworks folder between .NET 4 and .NET 4.5. What I needed to ask what could in .NET 4.5 really resolve the IE 11 issue. The major

Using GridView inside UpdatePanel

倖福魔咒の 提交于 2019-11-28 03:22:40
问题 I have an Updatepanel and Gridview inside it. <asp:UpdatePanel ID="uplPanel" UpdateMode="Conditional" runat="server" OnLoad="uplPanel_Load"> <ContentTemplate> <asp:GridView ID="gvPrList" runat="server" AutoGenerateColumns="false" AllowPaging="false" AllowSorting="false" CssClass="list-table" HeaderStyle-CssClass="header"> <Columns> <ItemTemplate> <asp:Button ID="btnEdit" runat="server" Text="Edit" CssClass="button save" OnCommand="onPrItemCmd" CommandName="editRow" CommandArgument='<%#Bind(

CalendarExtender wrongly positioned after scrolling

南楼画角 提交于 2019-11-28 03:06:51
问题 I am adding a CalendarExtender to a page, using the default styles. When I click the calendar button to trigger the calendar popup, the calendar displays normally. However, when I scroll down and click the button again, the calendar's position is not where it should be, as seen below. Why is this occuring and how do I fix it? EDIT: A bit about the implementation of this page. The CalendarExtender and TextBox are part of a WebPart added to a SharePoint 2007 Page. I am creating the extender

ASP.NET Validators inside an UpdatePanel

限于喜欢 提交于 2019-11-28 02:45:50
问题 I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit? 回答1: I suspect you are running the original release (RTM) of .NET 2.0. Until early 2007 validator controls were not compatible with UpdatePanels. This was resolved with the SP1 of the .NET Framework. The source of the problem is that