Test your technical skills online, appear in Virtual Interview and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Interviews Author
Thu, 17-Apr-2014 Authors
All Time Authors
Rajkatie
20480
Vishal@Neeraj
19600
Bharathi Cherukuri
18040

Latest members | More ...


(Statistics delayed by 5 minutes)

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

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

Answer:

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:




Latest Interview Questions

    Comments or Responses

    Login to post response.

    Comments / Responses
    Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
    Bold Italic Underline Paragraph Title Code  Link 
     Wait ... Processing ..... please wait.