简体   繁体   English

从内容页面中的updatepanel更新母版页的内容

[英]update content of master page from updatepanel in content page

I need to update content of master's master page in order to update shopping cart totoal price. 我需要更新母版母版页的内容,以便更新购物车总价。 I have a updatepanel in content page from where user add products. 用户在其中添加产品的内容页面上有一个updatepanel。 How can i update master's master contents/ label on click of button inside update panel. 单击更新面板中的按钮,如何更新主文件的主文件内容/标签。

As updatepanel async refresh updates its own area only, it is not possible to refresh another area (shopping cart total price). 由于updatepanel异步刷新仅更新其自己的区域,因此无法刷新另一个区域(购物车总价)。 One solution is to add another updatepanel around shopping cart total control and refresh it from serverside code when your main update panel refreshes/ 一种解决方案是在购物车总控制周围添加另一个updatepanel,并在主更新面板刷新/时从服务器端代码刷新它。

You can update that by using FindControl property . 您可以使用FindControl属性更新该属性。 Have a look at this article 看看这篇文章

Here is the Link 链接在这里

I faced a problem like this a few days ago, I solved it with jQuery. 前几天我遇到了这样的问题,我用jQuery解决了。

  1. Give the total shipping label a CSS class 给总运输标签一个CSS类
  2. Use jQuery to call that class form the jQuery script and update it's text. 使用jQuery从jQuery脚本调用该类并更新其文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM