悬赏园豆:10
[已关闭问题]
浏览: 4296次
关闭于 2008-03-04 15:25
<P>我想问一下:</P>
<P>需求:当,点完“确认(btnYes)"按钮之后,动态对“变价主题(lblPriceTheme)”进行赋值?</P>
<P>为什么进行赋值完之后,页面又快速刷新一下?对lable赋的值没有?<IMG title=qa height=413 src="http://www.cnblogs.com/images/cnblogs_com/RuiLei/124940/r_qa.JPG" width=640 mce_src="http://www.cnblogs.com/images/cnblogs_com/RuiLei/124940/r_qa.JPG"></P>
<P><asp:Button ID="btnYes" runat="server" Text="确认" OnClientClick="FillTheme()" OnClick="btnYes_Click" /></P>
<P>在button上有两个click事件,一个是用来动态对Label进行赋值,一个是把输入的值,保存到数据库中.</P>
<P>以下是Code: </P>
<P> <form id="Form1" runat="server"><BR> <ajaxToolkit:ToolkitScriptManager runat="server" ID="ToolkitScriptManager" /><BR> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional"><BR> <ContentTemplate><BR> <asp:Label ID="lblPriceTheme" runat="server" Text="变价主题:" /><BR> <asp:Label ID="lblPriceOrderType" runat="server" Text="类别:" /><BR> <asp:Button ID="btnFixTheme" runat="server" Text="修改" /><BR> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mdlPopup" runat="server"<BR> TargetControlID="btnFixTheme" PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" /><BR> <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" Style="display: none;"><BR> <div class="inner"><BR> <h2><BR> 填写变价主题</h2><BR> &am
问题补充:
<div class="base">
主题:<asp:TextBox ID="txtTheme" runat="server" ></asp:TextBox>
类型:<asp:RadioButtonList ID="rlType" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Selected="True" Value="0">普通</asp:ListItem>
<asp:ListItem Value="1">紧急</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="btnYes" runat="server" Text="确认" OnClientClick="FillTheme()" OnClick="btnYes_Click" />
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="$find('mdlPopup').hide(); return false;" />
</div>
</div>
</asp:Panel>
<script type="text/javascript">
Sys.Application.add_load(function()
{
$find('mdlPopup').show();
});
function $(id){
return document.getElementById(id);
}
function FillTheme()
{
var theme = $("txtTheme");
if(theme != null)
{
$get('lblPriceTheme').innerText+= $("txtTheme").value;
}
}
</script>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnYes" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</form>