简体   繁体   English

如何使用ASP.NET纯脚本ajax控件工具包中的ModalPopup?

[英]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.

相关问题 如何在.NET 3.5 Web应用程序中安装和使用ASP.NET AJAX Control Toolkit? - How do I install and use the ASP.NET AJAX Control Toolkit in my .NET 3.5 web applications? 如何使用CDN的Asp.net Ajax控制工具包? - How to use Asp.net Ajax control toolkit from CDN? CSLA,ASP.NET和AJAX ModalPopupExtender-当看不到ModalPopup时如何不加载对象 - CSLA, ASP.NET and AJAX ModalPopupExtender - how do I not load an object when the ModalPopup is not visible 如何找到我的MS ASP.NET AJAX Control Toolkit版本号? - How do I find the my version Number of MS ASP.NET AJAX Control Toolkit? 如何在asp.net中使用Ajax工具包? - How to use the ajax toolkit in asp.net? 来自ASP.NEt的HTMLEditorExtender AJAX Control Toolkit客户端onchange - HTMLEditorExtender from ASP.NEt AJAX Control Toolkit clientside onchange 如何使用JavaScript函数从ASP.NET AJAX Control Toolkit设置Slider控件值? - How to set Slider control Value from ASP.NET AJAX Control Toolkit with JavaScript function? 来自ASP.NET AJAX控件工具包的带有MaskedEditExtender的千位分隔符 - Thousand separator with MaskedEditExtender from the ASP.NET AJAX Control Toolkit 尝试使示例工作:如何在ModalPopup中使用ASP.NET AJAX UpdatePanel? - Trying to make example work: How to use ASP.NET AJAX UpdatePanel in ModalPopup? 安装ASP.NET AJAX控件工具包 - Installation of ASP.NET AJAX Control Toolkit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM