Doloto


Doloto is an AJAX application optimization tool, especially useful for large and complex Web 2.0 applications that contain a lot of code, such as Bing Maps, Hotmail, etc. Doloto analyzes AJAX application workloads and automatically performs code splitting of existing large Web 2.0 applications. After being processed by Doloto, an application will initially transfer only the portion of code necessary for application initialization.
to download and find more visit
http://msdn.microsoft.com/en-us/devlabs/ee423534.aspx

تعليقات

Session timeout notifcation - cont.

After writing previous post I figured that this message style work fine with normal page post back but when it comes for using asp.net ajax controls this functionality does not work until a real page post back happens   so you I figured that we need a special operation that update time status every time an ASP.Net Ajax happens so we need to add following code inside our page (Master page of-course  after script manager control)

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Request_End);
function Request_End(sender, args)
{
//$.unblockUI();
clearTimeout(mainTimer);
clearTimeout(subTimer);
mainTimer = setTimeout(”SessionTimeoutMessage(sessionTimeOut, limit)”, (sessionTimeOut - limit) * 1000);

}

Code explaination:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(Request_End);

get a reference of the page request manager and add to page end request event a custom function. for more details about this object you can visit following link:

http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys.WebForms/PageRequestManagerClass/default.aspx

inside our method we clear old timer and then call our old friend that trigger session counter to run from the beginning again and again on every AJAX call

Facebook style text area

During my small developing life I found how noisy to type in text area input control where you need to scroll to see data which make my web application users some time fell annoyed by this control especially in cases where you can’t use fancy text editor controls so I found face book site solved with simple and easy way by making this control in some way more dynamic depends on it content so I write following java script that convert all text area controls in page that include this script into face book text area style.

I will add code explenation later enjoy this code:

var defaultRowsCount = 2;

window.onload = function() {
//alert(getTextAreaElements().length);
elements = getTextAreaElements();
for(index = 0; index < elements.length; index++)
{
setTextAreaLength(elements[index]);

elements[index].onkeyup = elements[index].onchange = textAreaLength;
}
}

function textAreaLength(e)
{
setTextAreaLength(this);
}

function getTextAreaElements(){return document.getElementsByTagName(”textarea”);}
function setTextAreaLength(element)
{
data = element.value;
rows = data.split(’\r\n’).length

if(rows >= defaultRowsCount)
element.rows = rows;
else
element.rows = defaultRowsCount;
}

تعليقات