0

我的aspx 页面中有一些下拉控件。这些下拉列表的值来自数据库。对于每个下拉菜单,我们都使用了 asp:UpdatePanel。我想用 Telerik 替换代码。我不确定应该使用哪个控件来代替 UpdatePanel。1.我应该使用RadAjaxManager 或 RadAjaxPanel还是其他什么? 2.还有ContentTemplate 如何用teleirk替换

<td class="tbl_input">
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>                                                  
            <asp:ListBox ID="paymentSystem" runat="server" Rows="1"></asp:ListBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="paymentSystem"
                Display="Dynamic" ErrorMessage="* Please select the Payment system" SetFocusOnError="True" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="paymentSystem" EventName="SelectedIndexChanged" />
        </Triggers>
    </asp:UpdatePanel>
</td>

<td>
    <asp:UpdatePanel ID="UpdatePane2" runat="server">
        <ContentTemplate>
            <asp:ListBox ID="currency" runat="server" Rows="1">
                <asp:ListItem Value="">--- SELECT ---</asp:ListItem>
            </asp:ListBox>                            
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="currency"
                Display="Dynamic" ErrorMessage="* Please select the currency code for cash payment" SetFocusOnError="True" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="currency" EventName="SelectedIndexChanged" />
        </Triggers>
    </asp:UpdatePanel>
</td>

如何使用 Telerik 迁移此控件?

4

1 回答 1

0

有不同的方法可以做到这一点,也许 RadAjaxManager 会给您最大的灵活性。您可以在下面找到一个示例。至于 ContentTemplate 标记 - RadAjaxManager/RadAjaxPanel 控件不需要它。

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="paymentSystem">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="paymentSystem" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="currency">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="currency" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<td class="tbl_input">
    <asp:ListBox ID="paymentSystem" runat="server" Rows="1"></asp:ListBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="paymentSystem"
                                Display="Dynamic" ErrorMessage="* Please select the Payment system" SetFocusOnError="True" />
</td>

<td>
    <asp:ListBox ID="currency" runat="server" Rows="1">
        <asp:ListItem Value="">--- SELECT ---</asp:ListItem>
    </asp:ListBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="currency"
                                Display="Dynamic" ErrorMessage="* Please select the currency code for cash payment" SetFocusOnError="True" />
</td>

如果这是在用户控件/内容页面中,您可以改用 RadAjaxManagerProxy,因为 RadAjaxManager 是单例。

于 2015-06-09T14:12:10.830 回答