c# - ASP.NET register a control from external dll on a page -


Today I'm peating my head against a brick wall. I am porting a site that I developed on a new box in a new god and. I have not copied all the files yet because I did not have any large file structure and I would like to remove some parts of that code as I went.

Basically I wanted a website (file -> new -> web site) I wanted something like a file structure:

The new blank solution was created so that the SLN file is in its own right, then the projects (various DLL projects) and ASP Net Web Application

This last part has given me the reason for some issues that have given me headache, as far as I understand (it can be a little limited), a weblist (as I did before) The latter is different from what I have made. For example, to resolve the App_Code folder portion as previously did I have created a separate DLL for Web Library CS files and added a reference for it.

My problem now is how do I register it on a page to use it under control. For example, I have a control that comes from the text box, when it was in the App_Code folder, I could use it:

  & lt;% @ register TagPrefix = " Sarg "namespace =" mimamspace "%>  

then

  & lt; Use sarg: SARGTextBox id = "clienttitletxtbox" runat = "server" OnTextChanged = "textboxfiltering_TextChanged" AutoPostBack = "true" & gt; & Lt; / Sarg: SARGTextBox & gt;  

Now it is in its own DLL and Namespace, I do not understand how to work it, I just say warnings "I did not solve the symbol 'SARGTextBox' Can be done. "

This is probably really simple but now I can not see wood for trees.

Thank you

I think you have created a WebApplication instead of a website < / Li>

  • Then register your control in Web.config.
  •    & lt; Pages & gt; & Lt; Control & gt; & Lt; Add tagPrefix = "myctl" namespace = "namespace .classname" assembly = "assembly name" /> & Lt; / Control & gt; & Lt; / Pages & gt; 
    1. Rebuilding your solution
    2. Open the page and find your control with the toolbox and drop it on your page,

    Comments

    Popular posts from this blog

    asp.net - Javascript/DOM Why is does my form not support submit()? -

    sockets - Delphi: TTcpServer, connection reset when reading -

    javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -