Search
Winners

Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Advertisements
Top Interviews Author
Fri, 31-Oct-2014 Authors
All Time Authors
Vishal@Neeraj
38680
Rajkatie
20600
Bharathi Cherukuri
18040

Latest members | More ...


(Statistics delayed by 5 minutes)
 Exclusive Interview Question

Can you explain the concept of triggers in ‘UpdatePanel’ control?

Posted on 10/1/2009 | Category: ASP.NET AJAX Interview questions | Views: 6786




Triggers are child tags for ‘UpdatePanel’ tag. Many times we would like to update the panel when some event occurs or a value change on a control. This can be achieved by using triggers. There are two types of triggers ‘ControlEventTrigger’ and ‘ControlValueTrigger’. So let’s first understand ‘ControlEventTrigger’. Using ‘ControlEventTrigger’ we define on which control and at which event the update panel should refresh. Below is a simple code snippet for ‘ControlEventTrigger’. ‘ControlEventTrigger’ are defined using ‘<atlas:ControlEventTrigger>’ tag. We have numbered the code snippet below so let’s understand the same with numbers:-



  • 1 -> We need to define ‘ControlEventTrigger’ using ‘<atlas:ControlEventTrigger>’ tag.

  • 2 -> In this sample we will link trigger in ‘UpdatePanel1’ with the click event of ‘Button1’.

  • 3 -> In the ‘<atlas:ControlEventTrigger>’ tag we need to define the control and event using ‘ControlId’ and ‘EventName’ properties respectively.
    So now when the button click event happens ‘UpdatePanel1’ is refreshed.


Figure 18.12: - Code snippet for ‘ControlEventTrigger’


Using ‘ControlValueTrigger’ we can update a panel when an external control has reached some value. So again we need to define the same in a ‘Triggers’ tag. We need to put the ‘ControlvalueTrigger’ tag with control and property defined using the ‘ControlId’ property. So according to below code snippet when the value of ‘Textbox1’ changes we need to update the top panel.



Figure 18.13:- ‘ControlValueTrigger’ code snippet

Asked In: Many Interviews Alert Moderator 

Found interesting? Add this to:



Comments or Responses

Login to post response