[英]How do I use ModalPopup from the ASP.NET Script-Only ajax control toolkit?
I am using the ASP.NET Client-Side ajax control toolkit in my asp.net MVC application. 我在asp.net MVC应用程序中使用ASP.NET 客户端 ajax控件工具包。 I see that there is a .js file named "AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js" in the AjaxControlToolkit folder.
我看到AjaxControlToolkit文件夹中有一个名为“ AjaxControlToolkit.ModalPopup.ModalPopupBehavior.js”的.js文件。 However, I cannot find any examples on how to use it.
但是,我找不到有关如何使用它的任何示例。
[Edit] - As mentioned, I am using the Client-side, Script-only control toolkit. [编辑]-如前所述,我正在使用客户端,仅脚本控件工具包。 For those unfamiliar, here is the description from CodePlex:
对于那些不熟悉的人,这里是CodePlex的描述:
AjaxControlToolkit-ScriptFilesOnly.zip contains script files, CSS style sheets and pictures used by the toolkit.
AjaxControlToolkit-ScriptFilesOnly.zip包含脚本文件,CSS样式表和该工具箱使用的图片。 Use this download if you don't want to use embedded resources and prefer a file-based model.
如果您不想使用嵌入式资源,而是喜欢基于文件的模型,请使用此下载。
I have not been able to find many resources on how to use some of the scripts included with this. 我还没有找到很多有关如何使用此脚本附带的脚本的资源。 CodePlex link: http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx
CodePlex链接: http : //www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx
Yestarday I had the same need to use the popup extender and here are the js files which you should include first. Yestarday,我也有使用弹出式扩展程序的需求,这里是您应该首先包含的js文件。
<script src="javascripts/MicrosoftAjax.js" type="text/javascript" ></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.Compat.Timer.Timer.js" type="text/javascript"></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.Common.Common.js" type="text/javascript"></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.ExtenderBase.BaseScripts.js" type="text/javascript"></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.Animation.Animations.js" type="text/javascript"></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.DropShadow.DropShadowBehavior.js" type="text/javascript"></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js" type="text/javascript"></script>
<script src="javascripts/AjaxControlToolkit/AjaxControlToolkit.PopupExtender.PopupBehavior.js" type="text/javascript"></script>
The next step is to create the PopupBehavior from javascript like that: 下一步是从javascript创建PopupBehavior,如下所示:
$create(AjaxControlToolkit.PopupControlBehavior, {"PopupControlID":"div_to_popup","Position":3}, null, null, $get("textbox_input_id"));
If you need to use another control from the AjaxControlToolkit with scripts only without the burden of asp, here is one easy way to find the necessary include js files. 如果您只需要使用带有脚本的AjaxControlToolkit中的另一个控件而没有asp的负担,这是一种找到必要的include js文件的简便方法。 Go to its demo page here and look at the source of the page.
在此处转到其演示页面,然后查看页面的源代码。 At the bottom you will see how to create the control.
在底部,您将看到如何创建控件。 To find the include files needed for this control select CombineScriptsHandler.ashx and search for "//START".
若要查找此控件所需的包含文件,请选择CombineScriptsHandler.ashx并搜索“ // START”。 Every line with "//START" shows a script which is included in the page.
每行带有“ // START”的行将显示该页面中包含的脚本。
Check out the AJAX Toolkit samples . 查看AJAX工具包示例 。 There are live demos, walkthroughs and documentation.
有现场演示,演练和文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.