473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to trigger action in content page from an event on the master

vs2005, .net fw 2.0

the questions is, how can I cause the label to change in my client page
triggered by an event raised from the user control which is on my master page.

I have a master page (M) which contain a user control (U).

My client page (C) has a sub that needs to run if U raise an event.

The examlpe has been simplified to just button clicks and update label with
new messages.

Source ....

=====user control=====

Partial Class WebUserControl
Inherits System.Web.UI.UserControl
Implements ifMyUserControl

Public Interface ifMyUserControl
Event btClicked()
End Interface

Public Event wasClicked() Implements ifMyUserControl.btClicked

Protected Sub btFireEvent_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btFireEvent.Click
RaiseEvent wasClicked()
End Sub
End Class
==== Master Page ====

Partial Class MasterPage
Inherits System.Web.UI.MasterPage

Private Sub gotEvent() Handles WebUserControl1.wasClicked
Label1.Text = "WebUserControl's button was clicked and triggerd the
wasClicked Event and is handled in Masterpage."
End Sub

End Class
==== Client Page =====

Partial Class testFire
Inherits System.Web.UI.Page

' how to cause this sub to fire when the button in U is clicked?
Public Sub catchEvents()
Label1.Text = "Like to be able to update this when the WebUserControl's
wasClicked event was raised"
End Sub

End Class

May 10 '06 #1
0 1271

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kj | last post by:
How does one trigger an event programmatically? I'm interested in how to do this in both the "Level 0" event model as well as in the DOM Level 2 event model. Thanks! kj -- NOTE: In my...
1
by: TCORDON | last post by:
I have a master page that has a public property IdCountry. This property is changed by a user control on the master page using a "Bubbled" event so the event is handled on the master page for other...
1
by: dezza | last post by:
Hi, I am developing a web application that is a series of pages, rather like a wizard. Because all of the pages basically have the same navigation, and require the navigation buttons in the...
5
by: Federico | last post by:
I have a problem, I have an event declared in a Master Page, and I want to use in a Content Page holder of a Content Page. When I want to create the method to handle the event, I can njot reference...
2
by: Learner | last post by:
Hello, This is first time I have started using Master Pages. I am using ASP.NET 2.0 (VB) in Visual Studion 2005. This is how I am doing it... I have created a master page and placed a...
1
by: jpan | last post by:
My master page has a drop down list of languages. When the user selects a new language, I would like to call a method in the currently loaded content page to load all the fields with text in the...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
2
by: Zetatec2 | last post by:
I have a site I am making. It contains one master page that has two ASP label controls and about sixteen ASP button controls on it. Then I have sixteen content or slave pages. The user clicks on...
1
by: hemantkamb | last post by:
Hi…. I have created one website with Master and content page . I have taken TreeView Control on master page. And I wants that when I click to tree node the value of tree node is added to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.