does the page actually do a reload, but without firing the event? I have seen this, normally due to mysteryously disappearing eventhandlers. If I remembe correctly, i had to add the references to the back end file of the controls, and everything was ok from there.
There's a lot of it, but I'll try to post the essence of it.
I've got a Wizard class, which simply contains ascx files, each of which is a page in my wizard. It has a method called LoadControl which loads the wizard page into a placeholder on the page. This method takes a boolean flag, it is called in OnInit to load the control so that ViewState is restored, then called again in PageLoad, where it also sets up navigation buttons based on methods defined in the Interface that the wizard pages must impliment. I've looked at the HTML to ensure that the ID's are the same every time, and put in code to make sure that there are no automatically generated IDs anywhere. The current page ID is stored in viewstate, and the events that increment this are also working fine. It works really nicely, it loads the old page, then stores the values in the page into viewstate, then the event is fired and the new page is loaded, and any state restored. The problem comes with another control I've created, which is itself a composite of two controls we've written. My control binds these two controls to work as a particular view to browse our database, and a button that causes the view to flip between the two controls. This button is the event that is never fired in C#, although when I found an example in VB on the Visual Studio magazine site, it works fine. Porting it to C# also leaves me with events that don't fire. When Visual Studio finally wakes up from sorting out source control, I'll post some code.
The control gets loaded in my WizardControl like this:
I developed a WEB Forms page using C#. One of the bottons in the page says: Select File. When clicking this, I need to show a File Dialog showing files of client machine, once selected the file the program will open it and read data line by line. For File Dialog, I need the "using System.Windows.Forms;" but as I am using WEB forms, program does not allow me to include ....Windows.Forms.
How can I solve this problem? Is there an special File Dialog in Web Forms??
I found www.thecodeproject.com just before a week.Next week i asked a question "how to control web components in winform by embeding a browser(ie)" and i didn't thought so many people have took focus on it.So i am appriciated your help.But i am a beginner of programmer,so can you offer me a specific application example that is windows applicatin embeded a browser and we can draw Web componet such as TextBox on the browser interface?thank you for your help very much. myEmail:firstname.lastname@example.org
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 and ID 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 use InterfaceType.AutoDual or InterfaceType.AutoDispatch for the class interface. See Nick Parker's Creating a CCW for COM-enabled non-.NET Applications[^] for more details.
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?
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 different classid 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.
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).
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.
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.