Tags

//String Builder
function WriteTankToTable(tank) {

var sbBody = new Sys.StringBuilder(‘

‘);
for(x=0;x<tank.length;x++) {
sbBody.append(‘

‘);
sbBody.append(‘

‘);
sbBody.append(‘

‘);
sbBody.append(‘

‘);
sbBody.append(‘

‘);
sbBody.append(‘

‘);
}
sbBody.append(‘

‘ + x + ‘ ‘ + tank[x].get_fName() + ‘ ‘ + tank[x].get_lName() + ‘ ‘ + tank[x].get_email() + ‘

‘);

endTime = new Date().getTime();

sb = new Sys.StringBuilder(‘Start : ‘ + startTime);
sb.append(‘
‘);
sb.append(‘End : ‘ + endTime);
sb.append(‘
‘);
sb.append(‘Total : ‘ + (endTime – startTime));
sb.append(‘
‘);
sb.append(‘Loaded : ‘ + tank.length + ‘ ‘ + Object.getTypeName(tank[0]) );
sb.append(‘


‘);

sb.append( sbBody.toString() );

WriteToResults( sb.toString() );
tank = null;
}

function WriteToResults(value) {
var results = $get(‘results’);
results.innerHTML = value;
}

****************
A Web page can contain only one ScriptManager control, either directly on the page
or indirectly inside a nested or parent component. The ScriptManagerProxy control
lets you add scripts and services to content pages and to user controls if the master
page or host page already contains a ScriptManager control.
****************

****************
*Load Control
****************

//code behind
protected void Page_Load( object sender, EventArgs e )
{
TimeLabelButton timeControl =
LoadControl( “/usercontrols/TimeLabelButton.ascx” ) as TimeLabelButton;

NewControlPlaceHolder.Controls.Clear();

NewControlPlaceHolder.Controls.Add( timeControl);
}

****************
*AJAX Extensions
****************

  • document.getelementById = $get : used for html elements
  • $find = used for behaviors
  • $addHandler = easy way to add function delegates to controls
  • $addHandlers = add an array of delegates
  • $removeHandler = remove a single handler from an event
  • $clearHandlers = remove all handlers from an event. (be careful)
Advertisements