Home     |      Learn AJAX     |      Forum     |      Register     |      Submit Resource     |      Submit Article      |      Contact Us

AJAX-Tips Tutorials

 
Home AJAX-Tips
 

AjaxControlToolkit Tricks

 

Today we will take a look at a few AjaxControlToolkit tricks. If you have been working with ASP.NET long enough you know how important this function is to your Ajax based application. In fact, I have been looking online and most of the things I see related to the latest ASP.NET release are concerns regarding AjaxControlToolkit.


Without further ado – here they are:


Unlocking the language in CalendarExtender – CalendarExtender works only in English but that does not mean it will stay as it is. It is not that ASP.NET is biased for English-speaking users but since development is mainly in the English language, they might as well use it as their default.


But it could be unlocked and trick is surprisingly very easy. Look for the script called “EnableScriptGlobalization” and set it to “true”. That’s it! You just recompile the script and watch the calendar language change.


However, that solution is only good for changing the calendar. The header and the footer are still in English. Changing that is also relatively simple. The changes have to be done in the source code which is personally a little bit dangerous considering you have already tinkering with the underlying system.


Once you are there, look for this line: this._title.innerHTML = visibleDate.format("MMMM, yyyy");. The word you should look for is “format” and change it with “localeformat”. There are other date commands for header and footer and all you need to do is change it with “localeformat”.


Discarding Unnecessary Language DLL – this scenario happens when add a simple reference to AjaxControlToolkit.dll. That is a pretty simple action and should have no problem at all. However there is a problem which is really annoying. Along with the AjaxControlToolkit.dll, language directories get automatically piled up in the bin directory.


Even when you manually remove the directories, the subfolders go back once they are recompiled. Although that does not have any direct influence in the performance of the application, hundred of subfolders is very annoying.


The answer to this problem is to simple build another folder. Go to the Bin directory of your application and move the AjaxControlToolkit.dll along with its PDB to another folder. Just reference the folder using in your directory. There is a great chance the pesky subfolders will be removed since they do not have any references at all. But even if they will still exist, at least they are now located in a different folder.


Let the UpdatePanel do Force Full Page Postback – some will find this annoying but Force Full Page Postback can actually be useful in some situations. In a default situation, UpdatePanel can easily update some parts of the webpage.


Changing this format is very easy. The trick actually lies in the RegisterPostBackControl. By default, there is no additional information after this command or usually it should be controlled so that only parts of the webpage will be updated. But when you add (btnSearch); to the script, you will eventually have a Force Full Page Postback. All it needs is a simple change in one line and the function you need is right before your eyes.



Read Next: Using Microformats for Better Online Experience



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

AjaxWith.com Offers

  Blog Hosting

  Web Hosting

  VPS Hosting

  Dedicated Hosting

  Web Conferencing

  Online Backup

  VOIP

 

Sponsored Links