Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ActiveX (Read 9308 times)
Cristhian San Martin
Guest


ActiveX
Oct 11th, 2005 at 1:49pm
Print Post  
Hi how can i use the method BindtoControl from asp.net, i need host textbox, labels, combobox, etc in nodes
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX
Reply #1 - Oct 11th, 2005 at 3:02pm
Print Post  
Hi,

Try creating the controls on the client side from JavaScript. I am not sure you can instantiate windowed  controls in ASP.NET.

BindToControl works for windows of style bsWindow. I.e. don't use it with boxes of style bsAxControl.

If you need to use ActiveX controls, just assign their CLSID or PROGID to the box.AxControlId string property. That string should transfer fine to the client side and FlowChartX will create the controls there when LoadFromString is called.

Stoyan
  
Back to top
 
IP Logged
 
Cristhian San Martin
Guest


Re: ActiveX
Reply #2 - Oct 11th, 2005 at 3:36pm
Print Post  
Hi thanks for your answer, but i need to know... BindToControl method is only for windows forms? at this moment i use AxControlId whit activex controls  from javascript or vbscript its easy.. but i asking you if bindtocontrol would be better or i still use AxControlId , i want have the best perfomance for my asp.net aplicattion
thanks.........
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX
Reply #3 - Oct 11th, 2005 at 5:13pm
Print Post  
Hi,

It is better to use bsAxControl boxes because they have a reference to some COM intefaces that allow hosted controls to be serialized.

The bsWindow boxes with which you can use BindtoControl know only of the window handles and cannot serialize such windows properties.

Furthermore there is a better support for printing and print preview of bsAxControl boxes than for bound windows.

Stoyan
  
Back to top
 
IP Logged
 
Cristhian San Martin
Guest


Re: ActiveX
Reply #4 - Oct 11th, 2005 at 9:05pm
Print Post  
hi i have another problem when i create a box from vbscript there is no problem

set node = Form1.fc.CreateBox(200,330,100,40)node.AxControlId ="{D7053240-CE69-11CD-A777-00DD01143C57}"
node.Style = 8
node.AxControl.Caption = "Aceptar"

but when i create a box from the code behid of my aspx page whit this code

fc = new FLOWCHARTLib.FlowChartClass(); 
box aceptar = null;
aceptar = fc.CreateBox(200,330,90,25);
aceptar.AxControlId ="{0D9B96C6-2C5D-11D7-A1FB-0050BA3D8F2A}";
aceptar.Style = EBoxStyle.bsAxControl; 

i have a problem that says "ActiveX not instatiated" .... why from script it works and from codebehin not!!!!!

???
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX
Reply #5 - Oct 12th, 2005 at 8:22am
Print Post  
Hi,

That message is displayed in a box when the control whose CLSID is assigned to AxControlId cannot be created. I guess that means this CLSID:

{0D9B96C6-2C5D-11D7-A1FB-0050BA3D8F2A}

is not registered on the client side where the browser runs.

You might have to create a CAB file containing all OCX controls to be used on the page, and use it to install them on the client.

Stoyan
  
Back to top
 
IP Logged
 
Cristhian San Martin
Guest


Re: ActiveX
Reply #6 - Oct 12th, 2005 at 1:22pm
Print Post  
hi....

but i`m in the same computer, my computer is client and server at same time
i also using the method savetostring in the codebehind of my aspx page after create the flowchart and nodes, then i save in a string then from javascritp i read this string to create the diagram but it doesnt works.....
it is possible works whit the Savetostring method when you use nodes with activex hosted???
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX
Reply #7 - Oct 12th, 2005 at 1:45pm
Print Post  
Hi

If you assign that CLSID  {0D9B96C6-2C5D-11D7-A1FB-0050BA3D8F2A} with JavaScript on the client side - does the control appear correctly ?
  
Back to top
 
IP Logged
 
Cristhian San Martin
Guest


Re: ActiveX
Reply #8 - Oct 12th, 2005 at 3:21pm
Print Post  
hi another time...

Yes whit the CLSID 
{0D9B96C6-2C5D-11D7-A1FB-0050BA3D8F2A}
the control appear correctly, i dont know why from the code behind there problems.

From codebehind nodes whit normal shapes there is no problem, but when i use bsAxControl the activex doesnt appers only the message.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ActiveX
Reply #9 - Oct 12th, 2005 at 3:49pm
Print Post  
Hi,

Ok I guess ActiveX controls cannot be created on the server side because they need a parent window and the flowchart doesn't have a window in ASP.

You could try a workaround like this:

- set the AxControlId property on the server side
- but do not set Style = bsAxControl
- transfer to the client with SaveToString/LoadFromString
- now after LoadFromString on the client side for each box do

if box.AxControlId != ""
{
  box.Style = bsAxControl;
}

That will create the controls as defined by the AxControlId values set on the server side. The bad thing is that you cannot set the hosted controls properties on the server when they are not created there, you might have to devise a way to transfer values of the hosted controls via Tag/UserString.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint