我在.Net 4.5中有一个简单的ASP.Net Webforms页面,并使用2016年Q3版本的Telerik的ASP.Net Ajax RadControls。
我使用RadAjaxManager进行简单的ajax场景。但是,我发现RadAjaxManager的更新控件中的每个按钮都会自动成为异步回发触发器,即单击这些按钮会导致ajax回发。
这很奇怪,因为这些按钮在RadAjaxManager的配置中没有被列为AJAX启动器。
问题
这是RadAjaxManager的错误还是正常行为,我错过了什么?
码前
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadAjaxManagerIssue.aspx.cs" Inherits="RadAjaxManagerIssue" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<div>
<telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
</div>
<div>
<telerik:RadButton ID="RadButton1" runat="server" Text="RadButton1">
</telerik:RadButton>
</div>
<div style="margin-top:10px;">
<telerik:RadButton ID="RadButton2" runat="server" Text="RadButton2">
</telerik:RadButton>
</div>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadButton1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadButton1" UpdatePanelCssClass="" />
<telerik:AjaxUpdatedControl ControlID="RadTextBox1" UpdatePanelCssClass="" />
<telerik:AjaxUpdatedControl ControlID="RadButton2" UpdatePanelCssClass="" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
</div>
</form>
</body>
</html>
代码隐藏
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class RadAjaxManagerIssue : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RadScriptManager1.RegisterPostBackControl(RadButton2);
}
protected void Page_PreRender(object sender, EventArgs e)
{
RadScriptManager1.RegisterPostBackControl(RadButton2);
}
}