String extension in ASP.NET AJAX

This entry is part 8 of 13 in the series ASP.NET Ajax

ASP.NET AJAX client side framework also extends the string type to add support for the .NET like methods.

<html xmlns="">
<head id="Head1" runat="server">
<title>Client Side Event in ASP.NET Ajax</title>
<script language="javascript" type="text/javascript">
function pageLoad() {
var string = "";
<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="SM1" />

When you run the above .aspx page, you will get “true” and “true” alert. This alert comes because of ScriptManager that has string extension out of the box which helps us to deal with string in .NET style.

Now remove the ScriptManager and try to keep the pageLoad method in the body load and you shall get a JavaScript error because there is no endsWith or startWith method in the JavaScript.
Apart from Array and String extension, ASP.NET AJAX client side framework also provides other extension like Error type extension, Base type extensions that can be used to develop more robust, user friendly ASP.NET AJAX Application.

Series Navigation«Array extensions in ASP.NET AJAX client side frameworkScriptManager in ASP.NET Ajax»

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.