Ajax control toolkit’i bir projeme ekledim. Herhangi bir hata da almadım. Ama ne yaptımsa <ajaxToolkit:MaskedEditExtender> ve <ajaxToolkit:MaskedEditValidator> kontrollerini çalıştıramadım. Daha doğrusu özellikle MASK çalışmıyordu. Bunun çözümünü yaptığım araştırma sonucu şu şekilde buldum.
- Ajax Control Toolkit kurulumu.
- ACT’yi kullanmak istediğimiz projeyi açıyoruz.
- TOOL’s menüsünden “Nuget Package Manager>Package Manager Consol”
- “Install-Package AjaxControlToolkit” komutu ile ajax toolkit’i kuruyoruz.
- Kurulum bittikten sonra.
- Site.Master dosyasını açıyoruz.
- asp:ScriptManager kısmına geliyoruz. Burası normalde aşağıdaki gibi görünüyor olmalı.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
< asp:ScriptManager runat = "server" > < Scripts > <%--Framework Scripts--%> < asp:ScriptReference Name = "MsAjaxBundle" /> < asp:ScriptReference Name = "jquery" /> < asp:ScriptReference Name = "jquery.ui.combined" /> < asp:ScriptReference Name = "WebForms.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/WebForms.js" /> < asp:ScriptReference Name = "WebUIValidation.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/WebUIValidation.js" /> < asp:ScriptReference Name = "MenuStandards.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/MenuStandards.js" /> < asp:ScriptReference Name = "GridView.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/GridView.js" /> < asp:ScriptReference Name = "DetailsView.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/DetailsView.js" /> < asp:ScriptReference Name = "TreeView.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/TreeView.js" /> < asp:ScriptReference Name = "WebParts.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/WebParts.js" /> < asp:ScriptReference Name = "Focus.js" Assembly = "System.Web" Path = "~/Scripts/WebForms/Focus.js" /> < asp:ScriptReference Name = "WebFormsBundle" /> <%--Site Scripts--%> </ Scripts > </ asp:ScriptManager > |
- Bunu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
< ajaxToolkit:ToolkitScriptManager runat = "server" > < Scripts > <%--Framework Scripts--%> < asp:ScriptReference Name = "jquery" /> < asp:ScriptReference Name = "jquery.ui.combined" /> < asp:ScriptReference Name = "WebForms.js" Path = "~/Scripts/WebForms/WebForms.js" /> < asp:ScriptReference Name = "WebUIValidation.js" Path = "~/Scripts/WebForms/WebUIValidation.js" /> < asp:ScriptReference Name = "MenuStandards.js" Path = "~/Scripts/WebForms/MenuStandards.js" /> < asp:ScriptReference Name = "GridView.js" Path = "~/Scripts/WebForms/GridView.js" /> < asp:ScriptReference Name = "DetailsView.js" Path = "~/Scripts/WebForms/DetailsView.js" /> < asp:ScriptReference Name = "TreeView.js" Path = "~/Scripts/WebForms/TreeView.js" /> < asp:ScriptReference Name = "WebParts.js" Path = "~/Scripts/WebForms/WebParts.js" /> < asp:ScriptReference Name = "Focus.js" Path = "~/Scripts/WebForms/Focus.js" /> < asp:ScriptReference Name = "WebFormsBundle" /> <%--Site Scripts--%> </ Scripts > </ ajaxToolkit:ToolkitScriptManager > |
- Biçiminde değiştiriyoruz. (MsAjaxBundle ve Assembly=”System.Web” değerleri siliniyor.)
- Daha sonra ToolBox’a yeni bir TAB açıp isimmlendiriyoruz. (AJAX Control Toolkit gibi)
- Yeni açtığımız TAB’ın içinde farenin sağ butonunu tıklayarak choose items’i seçiyoruz.
- Browse komutunu kullanıyoruz.
- Projemiz dizinindeki Packages içinden ajaxcontroltoolkit.dll’i seçip onaylıyoruz. (Proje klasöründe packages yok ise Bin klasörüne bakın.)
Bundan sonra ajax kontrollerini kullanabilirsiniz.
.NET 4.5 ile AJAX Control Toolkit kullanımı