What is the "right" way to make a modular ASP.NET page?

Posted by Wayne Werner on Stack Overflow See other posts from Stack Overflow or by Wayne Werner
Published on 2010-05-20T16:18:39Z Indexed on 2010/05/20 16:20 UTC
Read the original article Hit count: 161

Hi,

I'm writing an internal program using ASP.NET (Visual Studio 2008). The basic premise is that folks will connect to the page through their web browser, put in some data (which will be validated and sanitized of course), click "submit" and then a query will be run on a database. I told you that story so I can tell you this story - I want to make my program modular for the likelihood that this program will be updated later on, and probably extended. My initial thought is to compile the database handler as a dll and then use its functionality on my page (see my little diagram). But I can't figure out how to hook the dll into my page - My Google-fu has failed which leads me to my questions:

1) Is creating a dll the "right" solution? If so, continue to question 2, if not, what should I be doing? Any resources/tutorial links would be appreciated.

2) How do I attach a dll? Visual Studio tells me I can't Imports from an .aspx page, and I've tried <%@ Import namespace="MyDllName" %> and a few other variations, none of which worked.

Thanks!

alt text

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about visual-studio-2008