Hi neobender,
As I see that you already linked your project, I assume you have no objections that I upload the modified version of it where I have added some simple JavaScript capable of firing an event to the Visual WebGui application.
Your remaining problem is that you need to control ID of the Visual WebGui wrapper control in order to be able to raise the client side Visual WebGui event to the correct server-side control. It is always interesting to view the rendered Html when figuring out the structure you need to account for, but the basic idea is that you need some starting DOM node and then start traveling up the DOM tree until you find a node that can give you this information. In the case of an ASP.NET wrapped control, it will be rendered inside an IFrame and you simply travel up the tree until you find one with id="TRG_xxx" where "xxx" is the Visual WebGui control ID.
The JavaScript code to do that could be something like this:
function getVWGcontrolID(objStartNode) {
var objCurNode = objStartNode;
while (objCurNode != null) {
if (objCurNode.parentNode)
objCurNode = objCurNode.parentNode;
else
return "undefined";
if (objCurNode.frames) {
if (objCurNode.frames.frameElement) {
if (objCurNode.frames.frameElement.id) {
var strID = objCurNode.frames.frameElement.id;
if (strID.substring(0, 4) == "TRG_")
return strID.substring(4);
}
}
}
}
return "undefined";
}
To call it, you need a starting DOM node as I already mentioned. Looking at the JavaScript already in the .aspx file, I notice that a variable "theForm" is set, so we can as well use it for this purpose.
You simply comment out the alerting line and place the following code:
var v = VWG.Services.GetApplication();
var strID = getVWGcontrolID(theForm);
var objEvent = VWG.Events.CreateEvent(strID, "message");
VWG.Events.SetEventAttribute(objEvent, "messagetext", "Test");
VWG.Events.RaiseEvents();
This should get your Visual WebGui client side event fired against the wrapper server-side control, and if you set a breakpoint on the FireEvent override, your breakpoint should be hit.
I uploaded the modified version of your project
here.
Hope this helps,
Palli