When run with the ide, there is an active window for the control (the one running the ide). When run with iis, which is a service, there is no window, and window controls will not work.
ActiveX grid control in asp.net
We are trying use ActiveX component grid control in asp.net server side code(hidden grid).
From asp.net code we are instantiating a class (from class library - dll reference) , in which a windows form is loaded from a thread (ApartmentState set to ApartmentState.STA)
We are getting following error while reading ActiveX control '.rows' property:
Property get of 'Rows' cannot be invoked at this time. Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.
'.name' property was returning proper value.
Same error is thrown to dynamic grid also, outside windows form.
Dim a As New grid1
a.CreateControl()
a.Rows = 5
Also, same code is working from the IDE(localhost) without error.
Is there any setting, to be done in asp.net project ?
2 answers
Sort by: Most helpful
-
-
IT Researcher 26 Reputation points
2021-10-21T09:16:10.78+00:00 solved after registering latest OCX in webserver