473,757 Members | 10,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.U serControl
Implements ifMyUserControl

Public Interface ifMyUserControl
Event btClicked()
End Interface

Public Event wasClicked() Implements ifMyUserControl .btClicked

Protected Sub btFireEvent_Cli ck(ByVal sender As Object, ByVal e As
System.EventArg s) Handles btFireEvent.Cli ck
RaiseEvent wasClicked()
End Sub
End Class
==== Master Page ====

Partial Class MasterPage
Inherits System.Web.UI.M asterPage

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.P age

' 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 1305

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

Similar topics

2
11364
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 address everything before the first period is backwards; and the last period, and everything after it, should be discarded.
1
1284
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 reasens becaus it has to update other content on the master page then the country is chaged, so far, so good. The problem starts when the content section in a page that uses this master page tries to read that property, because it reads it on the...
1
4554
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 same part of every screen, I have put the navigation buttons on the Master Page. The Content Pages, when they load, are able to change the caption of the navigation buttons as required by accessing the properties of the Master Page.
5
2566
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 the Master Page event, in its place IntelliSense shows me a Delegate Sub EventHandler. I am new with events managements, so any help and guiadance will be appreciated. Federico
2
1452
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 ContentPlaceHolder. And then by right cliking on the project I added a content page (by leaving the master page check box checked), ContentPage1.aspx. I have placed few text box controls and and couple of radio buttons. When I browse the page it perfectly...
1
2901
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 chosen language. My current approach is in the Content page to hook into the SelectedIndexChange event of the dropdown list (ID is ddlLanguage), but I am not receiving the event (see code below). Is there a better way to do this? Alternately,...
0
2115
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 sets a connection string to the database. The content page has a simple gridview that should show records from the selected database. Initial content page displays data from correct place. first change of dropdownlist correctly updates content...
2
1921
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 a button and that brings up the corrsiponding slave page in the master page. When a slave page comes up, data is read from a SQL server database into the ASP text boxes and ASP check boxes of each slave page. Once the controls have been...
1
4886
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 Session and data from database regarding to that tree node value. Will fetch the records and load that on content page on Content Page Load event. But the problem is that When click tree node the fallowing events occurs ...
0
9298
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.