MR. Heath Stewart come in please
-
I have an older example on a different site that I'm currently porting to CodeProject. Source is available from that site as well. The site itself bites.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
if i put a div element on the face of browser and set webconpontnet on the div, through this method can get the same result? ok
-
if i put a div element on the face of browser and set webconpontnet on the div, through this method can get the same result? ok
No, you have to use the
<object>
tag. Please read my article and for more details, see Deploying a Runtime Application in Internet Explorer[^] in MSDN. If you give the control andID
and you create a class interface for the control that uses[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
attribute (on ther interface), with[ClassInterface(InterfaceType.None)]
on the control (which implements the class interface as the first interface), you can access properties and call methods on the control like any other ActiveX controls. You should not useInterfaceType.AutoDual
orInterfaceType.AutoDispatch
for the class interface. See Nick Parker's Creating a CCW for COM-enabled non-.NET Applications[^] for more details.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
No, you have to use the
<object>
tag. Please read my article and for more details, see Deploying a Runtime Application in Internet Explorer[^] in MSDN. If you give the control andID
and you create a class interface for the control that uses[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
attribute (on ther interface), with[ClassInterface(InterfaceType.None)]
on the control (which implements the class interface as the first interface), you can access properties and call methods on the control like any other ActiveX controls. You should not useInterfaceType.AutoDual
orInterfaceType.AutoDispatch
for the class interface. See Nick Parker's Creating a CCW for COM-enabled non-.NET Applications[^] for more details.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
I know you mean,that is use winform control in web application.The method just as using ActiveX in web. But the .net framework is required in client. Did you mean we can move the control in web using the method you tell about a week ago? thank you!
-
I know you mean,that is use winform control in web application.The method just as using ActiveX in web. But the .net framework is required in client. Did you mean we can move the control in web using the method you tell about a week ago? thank you!
Of course an embedded Windows Forms control requires the .NET Framework to be installed on the client, just like Java applets require a JRE and ActiveX requires IE. If you read my article, you'd see that this is treating a Windows Forms control in a similar fashion to an ActiveX control (it uses the
<object>
tag with a differentclassid
value), and it can be scripted so long as the control uses dispatch interfaces (automation) that are exposed to the scripting host. It's all in my article. Note, though, that this has nothing to do with ASP.NET. It can be embedded into plain HTML documents, ASP, PHP, or anything, since it is completely client-side.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Of course an embedded Windows Forms control requires the .NET Framework to be installed on the client, just like Java applets require a JRE and ActiveX requires IE. If you read my article, you'd see that this is treating a Windows Forms control in a similar fashion to an ActiveX control (it uses the
<object>
tag with a differentclassid
value), and it can be scripted so long as the control uses dispatch interfaces (automation) that are exposed to the scripting host. It's all in my article. Note, though, that this has nothing to do with ASP.NET. It can be embedded into plain HTML documents, ASP, PHP, or anything, since it is completely client-side.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
i see. Now i am designing a application that enable users as server side can configurate some componets on the platform (just a winapplication embedded browser i said first time) the users as client side can watch the results.As you know the client side should comunication with server realtime to get data. Cmmonly we can refresh the browser to link to the server to get data,but when application need do this per 2 second this method cann't been used.Now i am confused about whether to design web components(how keep communicaion between server and client in background process) or winform component (use DCOM to keep their communicaion?anyother method?) .So, please give me some advice. thank you. 非常感谢您的帮助
-
i see. Now i am designing a application that enable users as server side can configurate some componets on the platform (just a winapplication embedded browser i said first time) the users as client side can watch the results.As you know the client side should comunication with server realtime to get data. Cmmonly we can refresh the browser to link to the server to get data,but when application need do this per 2 second this method cann't been used.Now i am confused about whether to design web components(how keep communicaion between server and client in background process) or winform component (use DCOM to keep their communicaion?anyother method?) .So, please give me some advice. thank you. 非常感谢您的帮助
Web Controls are merely server-side controls that are rendered as HTML. This would still require that the client refreshes the browser, or that you initialize a timer with a 2-second delay, or that you use the HTTP header "refresh" (or a META tag using http-equiv="refresh") with the value "timeout;url", where timeout is set to 2 and the url is the same page. If you use a Windows Forms control, you could use XML Web Service, Remoting, or Enterprise Services (DCOM) to communicate in real-time with the backend with the user needing to do anything, but the client should still poll for data (if using remoting hosted by IIS) because any remoting object hosted by IIS is configured as a Web Service and - because of the HTTP protocol - can only communicate one way (from client to server).
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Web Controls are merely server-side controls that are rendered as HTML. This would still require that the client refreshes the browser, or that you initialize a timer with a 2-second delay, or that you use the HTTP header "refresh" (or a META tag using http-equiv="refresh") with the value "timeout;url", where timeout is set to 2 and the url is the same page. If you use a Windows Forms control, you could use XML Web Service, Remoting, or Enterprise Services (DCOM) to communicate in real-time with the backend with the user needing to do anything, but the client should still poll for data (if using remoting hosted by IIS) because any remoting object hosted by IIS is configured as a Web Service and - because of the HTTP protocol - can only communicate one way (from client to server).
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
Now,i am decided to design Web component.Just as you say above if we design winfrom component we can use web servers,DCOM and so on,but when i do web component,how can i keep communication between client and server don't use to refresh.For example when i use DataGrid web component ,how can i update its data in client side without using refresh to connect to server side. 感谢你的帮助!!!
-
Now,i am decided to design Web component.Just as you say above if we design winfrom component we can use web servers,DCOM and so on,but when i do web component,how can i keep communication between client and server don't use to refresh.For example when i use DataGrid web component ,how can i update its data in client side without using refresh to connect to server side. 感谢你的帮助!!!
The important thing to remember is that the web browser is not communicating the with server. The server nearly sent the browser a page that contains an embedded object. That object communicates directly with the server as any other application - either embedded or standalone - would, using remoting, DCOM, or whatever. This is up to the implementation.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
The important thing to remember is that the web browser is not communicating the with server. The server nearly sent the browser a page that contains an embedded object. That object communicates directly with the server as any other application - either embedded or standalone - would, using remoting, DCOM, or whatever. This is up to the implementation.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
thanks you!Now the thing confused my head is that my web component can changed its surface when the data it bound to,but how can i make the same change apperaed in client connected with the server? 您的帮助将使我受益匪浅!
-
thanks you!Now the thing confused my head is that my web component can changed its surface when the data it bound to,but how can i make the same change apperaed in client connected with the server? 您的帮助将使我受益匪浅!
Here's an ASCII chart:
Web Browser (client) -> Request -> HTTP Server (server)
client <- Response <- server
Embedded Control (client) <-> DCOM/Remoting Server (server)Notice how the embedded control can communicate BOTH ways with the DCOM or Remoting server? See, you're missing the crutial point here and you must understand this or you're really in trouble. HTTP communication is essentially one way. Yes, the browser requests information from the server and the server sends it out, but the server cannot send out information without a request from a client application. For what you need, you are EMBEDDING a control in a Web page (which requires no refreshing of the web browser - think of it as a stand-alone appliation that just sits there) that talks directly with a DCOM or Remoting server on the server. If the client is not firewalled, the DCOM or Remoting service can make calls on the client as well. It's two-way communication. For a web browser, if you need to refresh data, you either have to have a javascript or browser behavior fetch data behind the scenes and update the DHTML page (or an ActiveX control or Java applet doing it in the foreground), or you have to refresh the page itself either using some javascript with a timer and
window.location.reload()
, or use the HTTP-EQUIV="refresh" META tag with the content="timeout;url" syntax. This is all in the MSDN Library and you should read it and understand this basic concept of the Web before you venture down a page blindly. It's crucial.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----