Using UserControls in a Web Site rather than a Web Application Project

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    Using UserControls in a Web Site rather than a Web Application Project

    I have been told that prior to SP1 you were forced to use the Create Web
    Site. link rather than the Web Application Project when using ASP.NET.
    Although I now know this, I have an existing site I need to help someone
    with and would like to know how to add a UserControl (an ascx file) in a web
    site created using the Create Web Site. link. If I drag the *.ascx file onto
    the page, it simply creates a link to it using the <atag. I have been
    unable to figure out how to add something to the system.web -pages ->
    controls section of Web.config, since Create Web Site. does not build DLLs
    the same way Web Application Project does. Can someone help me here?
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • Eliyahu Goldin

    #2
    Re: Using UserControls in a Web Site rather than a Web Application Project

    If you just place the ascx file into the web site directory, you should be
    able to use the control from the file in other pages in the same way as you
    would do in the web app project. Did you try this?

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]




    "Nathan Sokalski" <njsokalski@hot mail.comwrote in message
    news:eyuLuPJ5IH A.4272@TK2MSFTN GP03.phx.gbl...
    >I have been told that prior to SP1 you were forced to use the Create Web
    >Site. link rather than the Web Application Project when using ASP.NET.
    >Although I now know this, I have an existing site I need to help someone
    >with and would like to know how to add a UserControl (an ascx file) in a
    >web site created using the Create Web Site. link. If I drag the *.ascx file
    >onto the page, it simply creates a link to it using the <atag. I have
    >been unable to figure out how to add something to the system.web ->
    >pages -controls section of Web.config, since Create Web Site. does not
    >build DLLs the same way Web Application Project does. Can someone help me
    >here?
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

    >

    Comment

    • joteke

      #3
      Re: Using UserControls in a Web Site rather than a Web ApplicationProj ect

      Dragging in source view might do this, but if you do it in design
      view, it should do @register directives correctly. But as was said,
      there should be no difference in it web site vs project what comes to
      registering them on the page.

      Teemu

      Comment

      Working...