Script Manager: This control is responsible to manage & execute the Javascript required to implement AJAX features in a webpage. A Webpage that implements AJAX must have script manager control on it.
Script Manager Proxy: While working with master pages if the master page contains a script manager then all content pages created from that master page can use the script manager available on master page you can not take another script manager on the content page. If you want the reference of any external javascript file related to AJAX for that content page then you have to use script manager proxy.
Update Panel: update panel is used for implementing partial page update with AJAX. When post back occurs because of a control available in an update panel then only particular update panel will be post back to server and updated from server without disturbing the remaining page.
Update progress: This control is used to represent the progress of updating an update panel with a message or an image.
Timer : Timer control is used to repeatedly execute the code at specified intervals of time.
The following example demonstrates how to implement partial page update using AJAX.
L1.text=DateTime.NOW.Tostring(“T”) L2.Text=DateTime.Now.Tostring(“T”);
You can use multiple update panels on a page but when post back occurs because of a control available in one update panel then every update panel available on that page will be post back to server and updated from server and not only the update panel because of which the post back is occurs. This is because update mode property of update panel is set to ‘always’ by default. When you don’t want to post back an update panel when post back occurs because of another update panel then set update mode property of that update panel to ‘conditional’
The following example demonstrates how to work with multiple update panels on a webpage.
L1.Text=DateTime.Now.Tostring(“T”); L2.Text=DateTime.Now.Tostring(“T”);
Timer control is used to repeatedly execute the code at specified intervals of time. It has the property interval to specify the time interval in mille-seconds at which the code of that timer has to be repeated Timer control has the ‘tick’ event has the default event that will be raised whenever the interval set for timer elapsed. Ex: The following example uses the timer control to display the current system time on page continuously running.
page-Load event L1.Text = DateTime.Now.Tostring(“T”) tick event L1.Text = DateTime.Now.String(“T”);
The following example displays data from a table in database in a Grid view on the page and refresh it for every 20 seconds to reflect recent changes mode to on that page.
public void getdata() { sqlconnection cn=new sqlconnection(“server=Nikhil, database=Mydb;uid=sa;pwd=123”); sqlDataAdapter Da= new sqlDataAdapter(“select * from Dept”,cn); Dataset Ds=new dataset(); Ds.Fill(Ds,”Dept”); GVDept.Datasource=DS.Table[“Dept”]; GVDept.DataBind(); }
page-Load & tick event getdata(); getdata();
update progress control is used to indicate updating an update panel is in progress while it is updated from server. with a message or an image.
The following example demonstrates how to use update progress control to represent the progress of updating an update panel.
Button – click event : system.Threading.Thread.sleep(5000); Lable1.Text=”Button clicked”;
You liked the article?
Like : 0
Vote for difficulty
Current difficulty (Avg): Medium
1/15
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox