ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Using Class Library inside UserControl in ASP.Net C#<p><strong>In your one application Test.DL and Test.Web.UI Both are diffrent Project as Web user Interface and Data Access layer?</strong><br /><strong>If Yes the just follow the below steps.</strong></p> <p>1) Right click on Project Name Test.Web.UI and select Add Reference Option.</p> <p><img src="https://i.imgur.com/zsfZjvv.png" alt="" width="468" height="263" /></p> <p>2) Then Select <strong>Projects </strong>tab. where you need to select Project Name Test.DL and then click on Ok.</p> <p><img src="https://i.imgur.com/nt7SMbT.png" alt="" width="468" height="287" /></p> <p>3) Reference of Project Test.DL is now Added now in Test.Web.UI project in References Folder.</p> <p><img src="https://i.imgur.com/yoDCzJU.png" alt="" width="269" height="353" /></p> <p>4) You need to call the class from Test.DL file in Test.Web.UI so just Create object of class and use it If you have not Added name space which is same of class file in Test.DL then you need to add name space.</p> <p><img src="https://i.imgur.com/NHoUJ8b.png" alt="" width="468" height="150" /></p> <p><img src="https://i.imgur.com/S01btEN.png" alt="" width="468" height="90" /></p> <p><strong>Or if Your Test.DL is in another application in another project then you need to add its reference like below.</strong></p> <p>1) Right click on Project Name Test.Web.UI and select Add Reference Option.</p> <p><img src="https://i.imgur.com/zsfZjvv.png" alt="" width="468" height="263" /></p> <p>2) Then Select <strong>Browse </strong>tab. from where you can browse the Application name as Test.DL.</p> <p><img src="https://i.imgur.com/Nytf4dM.png" alt="" width="468" height="280" /></p> <p>3) Go in Bin Folder And Select Test.DL Dll file and click on Ok.</p> <p><img src="https://i.imgur.com/mDidP1f.png" alt="" width="468" height="278" /></p> <p>4) Reference of Project Test.DL is now Added now in Test.Web.UI project in References Folder.</p> <p><img src="https://i.imgur.com/yoDCzJU.png" alt="" width="269" height="353" /></p> <p>5) You need to call the class from Test.DL file in Test.Web.UI so just Create object of class and use it If you have not Added name space which is same of class file in Test.DL then you need to add name space.</p> <p><img src="https://i.imgur.com/NHoUJ8b.png" alt="" width="468" height="150" /></p> <p><img src="https://i.imgur.com/S01btEN.png" alt="" width="468" height="90" /></p> <p><strong>In sample Example I just users Default.aspx page where i am accessing the class name same way you can call class in your UserControl.</strong></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/141141/Using-Class-Library-inside-UserControl-in-ASPNet-C/https://www.aspforums.net:443/Threads/141141/Using-Class-Library-inside-UserControl-in-ASPNet-C/Wed, 10 Jan 2018 23:44:03 GMT