Get Started with ASP.NET AJAX

 

I recently finished up a new article discussing how to use ASP.NET AJAX Extension controls to AJAX-enable new or existing Websites quickly and easily.  It's now available on the Simple-Talk.com Website for those that are interested in getting into AJAX more.  Code samples that demonstrate how to perform a variety of tasks (including a few not discussed in the article) are available as well.   

Published Tuesday, May 01, 2007 6:03 PM by dwahlin
Filed under: ,

Comments

# » Get Started with ASP.NET AJAX

Tuesday, May 01, 2007 11:15 PM by » Get Started with ASP.NET AJAX

PingBack from http://testsubdomain.netmoviehost.com/get-started-with-aspnet-ajax/

# re: Get Started with ASP.NET AJAX

Thursday, May 31, 2007 5:04 AM by Rainer

Hi,

In your recent article "Enhance your Website with ASP.NET AJAX Extensions" you have this code in NestingUpdatePanels.aspx.cs-file:

private int SelectedRow

   {

       get

       {

           object index = ViewState["SelectedRow"] ?? "-1";

           return Int32.Parse(index.ToString());

       }

   }

Could you please translate the get-method in VB.NET, because all CS-VB translators doesn't recognize operator ??.

I've translated it into

Dim index As Object = IIf(CBool(ViewState("SelectedRow")), "0", "-1")

but it doesn't work. Obviously "0" (true part) is not right. Thanks

# re: Get Started with ASP.NET AJAX

Thursday, May 31, 2007 11:01 PM by dwahlin

?? is a short-cut way of checking if an object is null or not.  If it's not null, the value is used, if it is null the value on the right-side of the ?? operator is used.  VB.NET would look something like the following:

Dim index as Object = ViewState("SelectedRow")

If index Is Nothing Then

  index = "-1"

End If

Return Int32.Parse(index.ToString())