473,462 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RaiseEvent in VB

Hi everyone,
I got a quite interesting problem myself and got stuck.
I have an aspx page with a windows user control with it.

in the Windows Control. I have a RaiseEvent statement,
say OnClearAlarm, and tell the computer to RaiseEvent when
I click on the Panel.

in the webpage, I first load the user control, and then
have a javascript function to handle the event:
Form1.ClickMe::OnClearAlarm(), and inside the function, I
just call a new window for testing.

But somehow it just won't work correctly. Can someone
help me out here.

Carl

Code for Windows UserControl:
Public Event OnClearAlarm()

Private Sub Panel1_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Panel1.Click
RaiseEvent OnClearAlarm()
End Sub

Code for Web Page:
<form id="Form1" method="post" runat="server">
<OBJECT id="ClickMe" height="350" width="350"
classid="ClickMe.dll#ClickMe.UserControl1"
VIEWASTEXT></OBJECT>
<script language =javascript>
function
Form1.ClickMe::OnClearAlarm() {
alert("fggh");
newWindow = window.open
('MasterDetail.aspx');
newWindow.focus()
}
</script>
</form>
Nov 20 '05 #1
2 6785
* "Carl tam" <ct**@ase-usa.net> scripsit:
I got a quite interesting problem myself and got stuck.
I have an aspx page with a windows user control with it.

in the Windows Control. I have a RaiseEvent statement,
say OnClearAlarm, and tell the computer to RaiseEvent when
I click on the Panel.

in the webpage, I first load the user control, and then
have a javascript function to handle the event:
Form1.ClickMe::OnClearAlarm(), and inside the function, I
just call a new window for testing.

But somehow it just won't work correctly. Can someone
help me out here.


Seems to be a JavaScript problem, you will more likely get an answer
here:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet>

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.aspnet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Never Mind, everyone..
I found the solution of this problem. this is because the
dll must has a COM GUID inside of it in order for the dll
actually send the event to the client side to the
javascript. so instead of using usercontrol.vb, we would
have to add a new item under COM Class, from there, you
will need to copy the COM GUID (with the unique code
generated by the CLR) and the Declaration of the COM Class
(which is the first statement) into the usercontrol. then
compile it... there I can raise the event.. ^_^

-----Original Message-----
* "Carl tam" <ct**@ase-usa.net> scripsit:
I got a quite interesting problem myself and got stuck.
I have an aspx page with a windows user control with it.

in the Windows Control. I have a RaiseEvent statement,
say OnClearAlarm, and tell the computer to RaiseEvent when I click on the Panel.

in the webpage, I first load the user control, and then have a javascript function to handle the event:
Form1.ClickMe::OnClearAlarm(), and inside the function, I just call a new window for testing.

But somehow it just won't work correctly. Can someone
help me out here.
Seems to be a JavaScript problem, you will more likely

get an answerhere:

<news://msnews.microsoft.com/microsof...c.dotnet.frame work.aspnet>
Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp? url=/newsgroups/loadframes.asp?
icp=msdn&slcid=us&newsgroup=microsoft.public.dotne t.framewo
rk.aspnet>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #3

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

Similar topics

1
by: Guille | last post by:
Hi all! I'm having some weird behaviour in a .NET application i'm developing. I'll try to explain: I've created a Class that wraps an asynchronous socket. When connect callback is called, i...
8
by: Nicolas | last post by:
How do I do a RaiseEvent in csharp I'm ok in VB but csharp confused me a lot. ******* code ******** private FileSystemWatcher watcher = new FileSystemWatcher(); public delegate void...
20
by: Bob Day | last post by:
Using VS 2003, VB, MSDE... There are two threads, A & B, that continously run and are started by Sub Main. They instantiationsl of identical code. Thread A handles call activity on telephone...
2
by: Lim | last post by:
I've developed a program that raise an event. This program works fine on a Windows 2000 Professional PC. However when I try to run the program on a Windos XP Professional PC, the program will not...
2
by: dmoonme | last post by:
I'm trying to rename some files in a directory. Pretty basic stuff - renaming the files works fine but the problem I have is updated the text in textbox. All I want to do is appendtext to a...
7
by: Onokiyo | last post by:
Hello, I have the code below and somehow the message from RaiseEvent doesn't pop up at all. Can someone help me please? '------CODE '------/form1.vb/VB2005/Framework20--------- Imports...
3
by: Martin | last post by:
Hi all, I'm having a problem when trying to raise an event in my custom control when a toolstripbutton enable state changes. The problem is that although the code to raise the event executes, my...
1
by: Terry Olsen | last post by:
I have a program with a couple of long running processes that i'm calling on a separate thread. When the process is completed, I want to raise an event to tell the main thread that it's done. I...
10
by: hzgt9b | last post by:
Using VS2005, VB.NET, I am developing a windows app. The application opens a couple of forms. While the forms are open I want to raise some events, such as logging errors - but I call RaiseEvent,...
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
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.