Using an event handler between vb.net and c#

Posted on 2011-10-11
Medium Priority
Last Modified: 2012-05-12
We have a web page that uses vb.net code behind.  We have a user control that is written with c# code behind.

From the vb.net page we push a button that causes a modalpopup (ajax) to come to the screen.  The modalpopup displays our C# user control.  On this user control, the user enters some data and clicks search, and then this User Control needs to populate a grid view with some data.  Then the user will select something from the grid view and then data will go into a session variable that the vb.net page will use.  

Now, when we click the search button to do step 1 above, it calls back and does some server side processing and the modal pop up closes.  We want to show the modal pop up again and this is where the problem lies.

We have an event in the user control.  We are trying to call this event from the vb.net page.  When trying to code that we cannot access that event from the vb.net code.  

//Here is the event on the user control -
public event EventHandler UserControlButtonClicked;

'Then in vb.net we are trying to do this:
OrderSelector1. 'but there is no event name in there. please see screen shot.

Open in new window

Question by:Bran-Damage
  • 2
LVL 83

Accepted Solution

CodeCruiser earned 2000 total points
ID: 36949430
You need to use the AddHandler statement

AddHandler OrderSelector1.UserControlButtonClicked, Addressof yoursub

Author Closing Comment

ID: 36950054
Perfect thanks.
LVL 83

Expert Comment

ID: 36950066
Glad to help :-)

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Screencast - Getting to Know the Pipeline
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question