如何在1页中添加多个ajax控件 [英] How to add multiple ajax control in 1 page

查看:57
本文介绍了如何在1页中添加多个ajax控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





当我在已经拥有第二个ajax控件的页面中添加第二个ajax控件时,我遇到了问题。我已经嵌入了工具箱脚本管理器来创建一个tab容器。然后在那个选项卡面板中我想再添加一个控件,它是压延扩展器。



当我运行应用程序时日期没有插入到数据库中。作为目标的文本框没有值。它是空的。我怎么能这样做?







谢谢。

Hi,

i have a problem when i add second ajax control in a page which is already have one. i already embed toolkit script manager for creating a tab container.then in that tab panel i want to add one more control which is calender extender.

when i run the application the date is not insert into database.the textbox which is the target doesnt have the value.it is empty.so how can i do this?



thanks.

推荐答案



我给你简单的示例工作日历扩展器控制一个页面。



在web.config文件中添加AjaxControlToolkit控件。 br />
Hi,
I give you simple example working calender extender controls a single page.

Add AjaxControlToolkit control on web.config file.
<pages>
			<controls>
				<add tagprefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add tagprefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add tagprefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
				
			</controls>
		</pages>



添加Default.aspx




Add Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Multiple Controls Ajax
    </title>
</head>
<body>
   <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        
        <table>
            <tr>
                <td>
                    Date1
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate1" runat="server">
                    <ajax:CalendarExtender ID="CalendarExtender1"  runat="server" TargetControlID="txtDate1"

                       CssClass="cal_Theme1" Format="dd-MMM-yyyy">
                    
                </td>
            </tr>
            <tr>
                <td>
                    Date2
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate2" runat="server">
                    <ajax:CalendarExtender ID="CalendarExtender2" TargetControlID="txtDate2" CssClass="cal_Theme1"

                         runat="server" Format="dd-MMM-yyyy">
                    
                </td>
            </tr>
            <tr>
                <td>
                    Date3
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate3" runat="server">
                    <ajax:CalendarExtender ID="CalendarExtender3"  runat="server" TargetControlID="txtDate3"

                        CssClass="cal_Theme1" Format="dd-MMM-yyyy">
                    
                </td>
            </tr>
            <tr>
                <td>
                    Date4
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate4" runat="server">
                </td>
                <ajax:CalendarExtender ID="CalendarExtender4"  runat="server" TargetControlID="txtDate4"

                    CssClass="cal_Theme1" Format="dd-MMM-yyyy">
                
            </tr>
        </table>
    </div>
 </form>
</body>
</html>


您刚才举了一个如何添加additi的示例不同控件的onal扩展器。提问者询问如何向SAME控件添加多个扩展器。
You just gave an example of how to add additional extenders to DIFFERENT controls. The questioner is asking about how to add multiple extenders to the SAME control.


这篇关于如何在1页中添加多个ajax控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆