Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Input control loses Javascript after updatepanel partial postback

$
0
0

I have the following html:

<!DOCTYPE html><html><head runat="server"><meta name="format-detection" content="telephone=no"/><meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta charset="utf-8"/><link rel="icon" href="images/favicon.ico" type="image/x-icon"/><link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic%7CLato:300,300italic,400,400italic,700,900%7CMerriweather:700italic"/><link rel="stylesheet" href="css/fonts.css"/><link rel="stylesheet" href="css/bootstrap.css"/><link rel="stylesheet" href="css/style.css"/><title><%: Page.Title %> - Alvarium Activity</title></head><body><form runat="server">

//some more html here....

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True"></asp:ScriptManager><div runat="server" id="cartBody" class="cart-inline-body"><asp:UpdatePanel runat="server" id="UpdatePanelCartBody" updatemode="Conditional"><ContentTemplate><asp:Repeater runat="server" ID="repeaterCartItems" ItemType="AlvariumActivity.Models.CartItem" SelectMethod="GetMyCartItems"><ItemTemplate><div class="cart-inline-item"><div class="unit2 align-items-center"><div class="unit2-left"><a><img id="imageCartItem" src="image/<%#:Item.Product.ImagePath%>" width="150" height="112" /></a></div><div class="unit2-body"><h6 class="cart-inline-name"> <asp:HyperLink runat="server" ID="productNameCartItem" NavigateUrl="#" Text="<%#:Item.Product.ProductName %>" /></h6><div><div class="group-xs group-inline-middle"><div class="table-cart-stepper"><input class="form-input-count" id="quantityCartItem" type="number" data-zeros="true" value="<%#: Item.Quantity %>" min="1" max="1000"/></div><h6 class="cart-inline-title" id="totalCostCartItem"><%#: String.Format("{0:c}", ((Convert.ToDouble(Item.Quantity)) * Convert.ToDouble(Item.Product.UnitPrice)))%></h6></div></div></div></div></div></ItemTemplate></asp:Repeater></ContentTemplate></asp:UpdatePanel></div>

//some more html here

<script src='<%=ResolveClientUrl("~/js/core.min.js") %>' type="text/javascript"></script><script src='<%=ResolveClientUrl("~/js/script.js") %>' type="text/javascript"></script></form></body></html>

The quantityCartItem input control use CSS and Javascripts to display it properly.  the Javascripts are in the files core.min.js and script.js.  The CSS is in the file style.css.

Everything appears to work as expected when doing normal load of the page.  However, when doing asynchronous partial postback of UpdatePanelCartBody , the javascript is lost.  From reading other posts, I understand that this is expected with synchronous partial postbacks.   

Can anyone show me how to read back the javascript files back and associate/bind the proper javascript functions to the quantityCartItem input control?  Thanks in advance. 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>