在Updatepanel Dropdownlist中回发后如何刷新Usercontrol? [英] How to Refresh Usercontrol after postback in Updatepanel Dropdownlist?

查看:62
本文介绍了在Updatepanel Dropdownlist中回发后如何刷新Usercontrol?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的aspx页面中有2个Updatepanels.
第一个updatepanel具有下拉列表,且自动回传为true
第二个updatepanel中具有用户控制

我的需要是,基于下拉列表的SelectedItemvalue,用户控件应具有相应的行为.

当我更改dropdownlist索引时,它首先触发了usercontrol,然后selectedindexchanged触发了.
因此,无法在用户控制代码文件中获取最新值.

请查看标记代码

Hi all,

I have 2 Updatepanels in my aspx page.
1st updatepanel has dropdownlist with autopostback as true
2nd updatepanel has usercontrol in it

my need is, Based on SelectedItemvalue of dropdownlist the usercontrols should behave.

When i change the dropdownlist index, it is firing the usercontrol first, then selectedindexchanged is firing.
So, unable to get the latest value in usercontrol code file.

please look at the markup code

<asp:Content ID="Content3" runat="server"         ContentPlaceHolderID="cph_fieldset_before">
<asp:ScriptManager runat="server" EnablePartialRendering="true" 
          ID="ScriptManager1" />
<asp:UpdatePanel runat="server" ID="updatePanel1"  UpdateMode="Conditional" >
<contenttemplate>
<div class="optional" id="printerTeamLeftList_Div" tabindex="-1">
<label for="projectTeamList">Printer(s)</label>
<asp:DropDownList runat="server" id="printerTeamList" rows="8" 
           datatextfield="Name" datavaluefield="ID" AutoPostBack="true" />
</div>
</contenttemplate>


<asp:UpdatePanel runat="server" ID="updatePanel2" UpdateMode="Conditional">
<contenttemplate>
<div class="no-border">
<dttwnew:twlinksnew  runat="server" id="twlinknew" foldertype="pretwo"/>
</div>
</contenttemplate>



有人可以指导我吗..

谢谢和问候,
Pawan.



Can somebody guide me on this..

Thanks and Regards,
Pawan.

推荐答案

对于第二个更新面板,您已将更新模式设置为有条件".只需将AsynchronousTrigger属性设置为printerTeamList的SelectedIndex更改事件.查看 http://mattberseth.com/blog/2007/07/indepth_the_updatepanel_aspnet.html [ ^ ].

希望这会有所帮助.
一切顺利.
For second update panel you have made the update mode Conditional. Just set the AsynchronousTrigger property to the printerTeamList''s SelectedIndex change event. Check out http://mattberseth.com/blog/2007/07/indepth_the_updatepanel_aspnet.html[^] for AsyncPostbackTrigger.

Hope this helps.
All the best.


这篇关于在Updatepanel Dropdownlist中回发后如何刷新Usercontrol?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆