在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.