Question

I have a project which is a Web Site, not Web Application and have two problems because of that.

  1. I have a custom control derived from BaseValidator which I had to put in the App_Code folder. Now on the page I want to register this control by <%@ Register tagname="mytagname" Namespace="PP" TagPrefix="dv2" %> But when I get enter to this page, I have exception, because the src attribute is missing. I can't put in the src attr. path to the App_Code because I have another exception. How can I do that? This is a Web Site, so the sources are not compiled to one dll file, so I don't know what to add to the src attribute.

  2. When I want to add to the Web Site a new project library, I have to compile it and manually copy the library dll file to the bin folder in the Web Site. But don't know, how can I debug this library with brakepoints?

This is my first time with Web Site project type. I always created the Web App.

Was it helpful?

Solution

1- Don't use tagname attribute here, tagname is suitable for UserControls.

http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx

2- There is no any difference between using library in a web app or website. Just choose Add Reference from project node's context menu and select your class library from project tab.

OTHER TIPS

Try creating a separate project for your CustomControls and reference it in your WebSite project by the namespace you use in your CutomControls project. Also check out this post for some information asp.net add custom control in website

Your second question, if you keep all of your projects in the same solution and just reference them to each other's projects, you will be able to debug and step into methods and set break points in any of the projects in your solution. If you don't want to do that, you have to copy the debug symbol files along with the .dll to the bin or point VS to where the necessary debug symbol files are located and then you will be able to step through the code in the .dll

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top