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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page.ParseControl on Window Application ?

Page.ParseControl on Window Application ?

Scheduled Pinned Locked Moved ASP.NET
helpdesignquestion
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.
  • T Offline
    T Offline
    Tee
    wrote on last edited by
    #1

    Normally, I use Page.ParseControl on a Web Application without any problem. But now it is time that i need to run this on a Window Application. Page aPage = new Page (); try { System.Web.UI.Control ctrl = aPage.Page.ParseControl(result); } catch (Exception e) { throw new Exception (e.Message); } This code get a run-time error: Object referencen not set to an instance of a object. Therefore, I am not sure can we use this code on window application ??? Please help....

    P 1 Reply Last reply
    0
    • T Tee

      Normally, I use Page.ParseControl on a Web Application without any problem. But now it is time that i need to run this on a Window Application. Page aPage = new Page (); try { System.Web.UI.Control ctrl = aPage.Page.ParseControl(result); } catch (Exception e) { throw new Exception (e.Message); } This code get a run-time error: Object referencen not set to an instance of a object. Therefore, I am not sure can we use this code on window application ??? Please help....

      P Offline
      P Offline
      parsiphal
      wrote on last edited by
      #2

      Hi there! uhm, it's quite strange for me to see your trying. I'll try to do my best, if it can be enought. I will show you things as I see them, but I'm sorry my view can be wrong or affected by lack of know-how. The first thing makes me strange is the overlapping of two separated domain. ASP.NET is an Application server which I'm not skilled to say how much (and how) rely on IIS. It's true that ASP.NET is part of the framework. Another domain you enter, in my opinion, when you develop under System.Windows.Form if you take me, for ASP.NET server are no longer involved in the processing: it makes direct way to CLR. Probably when you try to instance a System.Web.UI.Page you are going on a different process, but same Application Domain... it's a little complex to deal with these situation if the incapsulation of your component is not highly. If ever this instance can be obtained by the raw code you paste in your message, I don't know, but it would seems to me logic if cannot. Still, I'm sure there is a way to use ASP.NET elements from Windows Application. But it must pass throug separation of roles: ASP.NET classes are doomed to be executed on ASP.NET web server. You can search some for embedding a little gateway to an ASP.NET webserver in a Windows Application, or use an embedded proxy and show directly the HTML output from the HTTPRequest, or try to deal with soket and HTTP protocol to make some talks between your web application on one side, and your windows application from the other side. Anyway I'm thinking (and assuming) you'd like to instance ASP.NET classes in your System.Windows.Form. That is still possible, I rekon, as long as you provide the ASP.NET class with a context capable of execute the class on a ASP.NET server. This can be done either bringing a little sub-server in your application (if you can find some portable or embedded), or delegating your ASP.Net-work to a (remote) server, and making your WinApp to behave like a thin client (probably you need for a context that can render HTML tags at least, so you need of a WebBrowser: search .Net classes). It is my opinion as far as my skills let me to see (or guessing :)). I hope this is a little help, Parsiphal

      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