Working with AJAX Control in ASP.NET using VB.NET

With the help of this program we learn that how can do work in ajax and use a control in asp.net.
  • 2617

Introduction: How can we work in ajax with asp.net and use ajax control in webform.

Ajax (Asynchronous JavaScript and Xml) is combination of many application Javascript, Html, Dhtml,Xml.with the help of ajax we create webpage .when user perform any action then ajax  provide content on web page like http request:
 

Step :1 How can create any page:

  • Open visual studio:
  • Go to file menu and select website option .
  • We select ASP.NET  website.
  • Click in ok option .
  • Default.aspx page will be open.
sat1.gif

sat2.gif
 

Step: 2 Go to SolutionExplorer :

  • Right click inD:\RAJESH\WebSite  which are show that drive folder name and project name.
  • Select add new item and double click
  • Select WebForm in the page and click in add option.
  • Open default.aspx page..
  • We click in design option in Default.aspx page.
sat4.gif

sat5.gif
 

Step:3 How can put the control :

  • Go to the toolbox option.
  • Click ajax extensions option.
  • Select scriptmanager control,updatepanel control.
  • Select button ,label in standard control.

sat6.gif
 

Step:4  Write a code for page:

  • Double click in form.and write a code .

Code

    Protected Sub Page_Load(sender As Object, e As EventArgs)

       Label1.Text = DateTime.Now.ToString()
 

            Label2.Text = DateTime.Now.ToString()

   End Sub 

Step:5 Write a code for button:

  • Go to form double click in button.

Code:

   Protected Sub Page_Load(sender As Object, e As System.EventArgs

      Label1.Text = DateTime.Now.ToString();

      Response.Write("my ajax page");
 

   End Sub

Step :6 Go to default.aspx page

  • Put the label,button control inside a updatepannel

Note: When we inside the button and label control in updatepannel then we click in button then see only change in label which are inside in updatepannel control.

sat7.gif

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.