Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Web request from Windows Forms user control

Web request from Windows Forms user control

Scheduled Pinned Locked Moved C#
tutorialwinformssysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shree
    wrote on last edited by
    #1

    I have written a user control, and displayed it on a web page. There is a server side application that is supposed to provide the user control the data. I can do this through setting a property of the user control. What I am stuck at is how to make the user control request data to the server side application. A simple example. I have a user control with a label and a timer on it. On each timer tick, I want the user control to request the server side application to populate the label with the current time at the server.

    H 1 Reply Last reply
    0
    • S Shree

      I have written a user control, and displayed it on a web page. There is a server side application that is supposed to provide the user control the data. I can do this through setting a property of the user control. What I am stuck at is how to make the user control request data to the server side application. A simple example. I have a user control with a label and a timer on it. On each timer tick, I want the user control to request the server side application to populate the label with the current time at the server.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      The user control is not confined to the typical request/response mechanism of the web page in which it's embedded, so you can communicate with the server using Web Services or .NET Remoting (or some proprietary socket communication, which I wouldn't recommend). So while the page the user is viewing may be static (i.e., they haven't refreshed it) the user control is happilly communicating with the server. Also, you could have the page using XMLHTTP (a scripting component, or automation server) and set properties/call methods on the user control so long as it exposes automation information through dispatch interfaces. See my old article on DevHood about this: User Controls for Windows and the Web[^].

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups