473,396 Members | 2,018 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,396 software developers and data experts.

Web User Control Events

This is driving me crazy -- I'm trying to raise an event
in a web user control and respond to it in a web page.
It's a datagrid in a Web User Control which sits in a
template column of another datagrid on a web page. I
believe I'm raising the event because the first trace.warn
("WriteName") in the control is executing. The Second
(trace.warn("Dave")) is not. Any ideas?

---------------------------------------------------

In the User Control:

Public Event WriteName(ByVal s As Object, ByVal e As
System.EventArgs)
...
...
Private Sub _grdTitles_EditCommand(ByVal source As
Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs )
Handles _grdTitles.EditCommand
trace.warn ("WriteName")
RaiseEvent WriteName(Me, e)
End Sub
------------------------------------------------------

In the web page aspx:

<uc1:TitlesGrid id=grdTitles runat="server"
TitlesDataSource='<%#container.dataitem.createchil dview
("PublishersTitles")%>' TitlesDataMember="Titles" />

Web page Code:

Protected WithEvents MyTitles As TitlesGrid
...
...
Private Sub MyTitles_WriteName(ByVal s As Object, ByVal e
As System.EventArgs) Handles MyTitles.WriteName
Trace.Warn("Dave")
End Sub
Nov 17 '05 #1
1 2689
I'm not sure but I think that the problem lies within the aspx/web page
code, you define a Titlesgrid called 'grdTitles' and then in code you define
a Titlesgrid called MyTitles, I believe you should use :

Protected WithEvents grdTitles As TitlesGrid

Kind regards,

Jurjen de Groot
Netherlands.

"dave" <an*******@discussions.microsoft.com> wrote in message
news:0f****************************@phx.gbl...
This is driving me crazy -- I'm trying to raise an event
in a web user control and respond to it in a web page.
It's a datagrid in a Web User Control which sits in a
template column of another datagrid on a web page. I
believe I'm raising the event because the first trace.warn
("WriteName") in the control is executing. The Second
(trace.warn("Dave")) is not. Any ideas?

---------------------------------------------------

In the User Control:

Public Event WriteName(ByVal s As Object, ByVal e As
System.EventArgs)
...
...
Private Sub _grdTitles_EditCommand(ByVal source As
Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs )
Handles _grdTitles.EditCommand
trace.warn ("WriteName")
RaiseEvent WriteName(Me, e)
End Sub
------------------------------------------------------

In the web page aspx:

<uc1:TitlesGrid id=grdTitles runat="server"
TitlesDataSource='<%#container.dataitem.createchil dview
("PublishersTitles")%>' TitlesDataMember="Titles" />

Web page Code:

Protected WithEvents MyTitles As TitlesGrid
...
...
Private Sub MyTitles_WriteName(ByVal s As Object, ByVal e
As System.EventArgs) Handles MyTitles.WriteName
Trace.Warn("Dave")
End Sub

Nov 17 '05 #2

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

Similar topics

1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
1
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the...
5
by: George Durzi | last post by:
I have a simple user control with a text box and a submit button. When the user enters some text into the textbox and clicks the submit button, a record is created in the database. I'm using...
10
by: George G. | last post by:
Hi there, I am busy writing a new asp.net application and I am reusing some of my existing asp functions and methods in a user control. I need access to session, request and response in some of...
4
by: thomson | last post by:
Hi all, i do have a user control with 4 buttons, and all the events are firing properly, My problem is that i need to right an event handler in the user control, which gets fired after a...
4
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once...
6
by: Art | last post by:
Hi I'm new at this and need some help. I have a "solution" with 2 projects - the main project and a library. The library is simple, it contains a text box that will appear many times in the form...
1
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.