如何插入ajax工具确认按钮c#

本文关键字:工具 确认 按钮 ajax 何插入 插入 | 更新日期: 2023-09-27 18:29:32

我是AJAX新手当我进入网页时,它会给出一个错误``(c:''Users''Acer''Desktop''RSS_proje''RSS_proze''WebApplication2-5.2''ShareRss.aspxvar lblMsg=$get('<%=lblMessage.ClientID%>');){"类型为"ScriptManager"的控件"ScriptManager1"必须放置在runat=server的表单标记内。"}

javascript side

HTML code[code:html]<asp:ScriptManager ID="ScriptManager1" runat="server">

  function onCancel() {
    var lblMsg = $get('<%=lblMessage.ClientID%>');
    lblMsg.innerHTML = "You clicked the <b>Cancel</b> button of AJAX confirm.";
}

  also, button side

   <asp:Button ID="Button1" runat="server" Text="Share RSS" BackColor="#FF6600" 
            BorderColor="#FF9933" BorderStyle="Solid" Font-Bold="True" ForeColor="White" 
            Width="78px" onclick="Button1_Click" />
            <ajaxToolkit:ConfirmButtonExtender ID="cbe" runat="server"
TargetControlID="Button1"
ConfirmText="Are you sure you want to share this?"
OnClientCancel="CancelClick" />
 <asp:Label ID="lblMessage" runat="server"></asp:Label><br />

C侧

                 protected void Button1_Click(object sender, EventArgs e)
    {
        lblMessage.Text = "You clicked the <b>OK</b> button of AJAX confirm";
     }

如何插入ajax工具确认按钮c#

如果ScriptManager标记的格式与您发布的完全一样,那么请确保您为其提供了适当的结束标记。如果您已经提供了,您是否可以发布更多的标记,以便我们可以更好地了解您的Dom是如何构建的