ASP.NET - dll

Asked By naresh
18-Jul-11 08:00 AM
Hello Friends,

please tell me full example to creating a DLL file to Web application not Window application and how to implement in web application. using asp.net
  Vickey F replied to naresh
18-Jul-11 08:06 AM
You can create class library project in .NET and then reference that class library in your web application. But when creating class library for web application, dont forget to add reference to System.Web assembly. This is because System.Web contain classes and contexts for web application and hence you want to use your library for web application, you must include it. If you will not reference System.Web you will not get reference to your current HttpContext and many other web related context.
  K S replied to naresh
18-Jul-11 08:06 AM
See this: http://nishantrana.wordpress.com/2008/01/28/using-net-assembly-dll-in-asp-page/
  Riley K replied to naresh
18-Jul-11 08:13 AM
To create an dll you will need to create a project class library project.

 In this project you will create your reportclass.vb class file. When you build this it will produce the DLL file

Now to use this in your website you can either add a project reference to this class library project, or add a file reference to the DLL it produced. 
  Reena Jain replied to naresh
18-Jul-11 08:17 AM
hi,

To create an assembly you will need to create a project class library project. In this project you will create your reportclass.vb class file. When you build this it will produce the DLL file. Unfortuantely you cannot create web pages in this type of project.


here are the steps

  • make a simple class project
  • Build this project
  • go to debug folder
  • here is a *.dll file found
  • dll is ready for use
Now to use this in your website you can either add a project reference to this class library project, or add a file reference to the DLL it.

Hope this will help you
  dipa ahuja replied to naresh
18-Jul-11 08:19 AM
Untitled document

To create an assembly you will need to create a project class library project. In this project you will create your reportclass.vb class file. When you build this it will produce the DLL file. Unfortuantely you cannot create web pages in this type of project.

Now to use this in your website you can either add a project reference to this class library project, or add a file reference to the DLL it produced.

  Devil Scorpio replied to naresh
19-Jul-11 01:50 AM
Hi naresh,

Create a DLL file to Web application

You need to create a new project using the template "Class library". Then you  can either project reference the "class library" project, or reference the DLL output of it from your web application

Full example of creating a DLL file to web application

Open visual studio --> create new project --> select Class Library\

http://www.lynda.com/Visual-Studio-2010-tutorials/essential-training/Creating-a-class-library/76612-4.html

Implement DLL in web application

1. Create the page as normal with an aspx.vb code-behind file.

2.In the code-behind file, make the Sub declarations Public instead of Protected. Otherwise, you will not be able to call them in the .dll file from your page.

3.For the compiler to recognise them as members of their class, you will need to declare all references to controls using:

Protected WithEvents controlName As System.Web.UI.WebControls.ControlType

You will receive an error message like the one shown below in the Error List window - just ignore it:

'uxSubmit' is already declared as 'Protected Dim WithEvents uxSubmit As System.Web.UI.WebControls.Button' in this class.

4.You will also need to declare the Class as Public instead of Partial.

5.If you don't already have it, download and install the .NET Framework 2.0 Software Development Kit (SDK) from the Microsoft website.

6.From the Start menu, open the SDK command prompt.

7.Navigate to the directory containing your code-behind file.

8.Enter the following command to compile your code-behind file:
vbc /t:library /r:system.dll,system.web.dll default.aspx.vb

9The .dll file will have been created in the same directory as your code-behind file. Now you need to add this to your web application's bin directory. Go back to Visual Web Developer and add a reference to the .dll file you just created:

Website > Add Reference > Browse

The .dll file will be placed automatically in your project's Bin directory.

10.The last thing you will need to do is delete the reference to the CodeFile in your .aspx page's Page header tag.

11.You can now delete the .aspx.vb code-behind file if you wish

Create New Account
help
these: 1. Turn off Session State, if not required 2. Disable View State of a Page if possible 3. Set debug = false in web.config 4. Use the String builder to Client Side Scripts for validations 7. Avoid unnecessary round trips to the server 8. Use Page.ISPostBack 9. Use Foreach loop instead of For loop for String Iteration 10. Use "ArrayLists you. 1. Turn off Session State, if not required 2. Disable View State of a Page if possible 3. Set debug = false in web.config 4. Use the String builder to Client Side Scripts for validations 7. Avoid unnecessary round trips to the server 8. Use Page.ISPostBack 9. Use Foreach loop instead of For loop for String Iteration 10. Use "ArrayLists HI you need to do the following inorder to increase performance of an application:- 1. Declare connection string in a centralised way i.e in web.config. 2. Write stored procedures with proper indexes Do not use so many sub queries instead use Joins Also in Visual Studio 2010 has got excellent in bbuilt feature to test the performance of your application From Debug
have the TableAdapter wizard automatically create these stored procedures. When porting a legacy application to ASP.NET 2.0 or when building an ASP.NET 2.0 website around an existing data model, chances are that the database already contains at the steps needed to manually add new stored procedures to the database through the Visual Studio environment. Let s get started! Note: In the Wrapping Database Modifications within a Transaction tutorial within the scope of a transaction. Step 1: Adding Stored Procedures to the Northwind Database Visual Studio makes it easy to add new stored procedures to a database. Let s add a
Error: Object reference not set to an instance of an object Here is what appeared in of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 121: Line 122: con.Open(); Line 123: SqlCommand cmd = new SqlCommand("insert into Registration Line 125: txtDepartment.Text + "', '" + txtApproved.Text + "', '" + txtVisitationPurpose.Text + "')", con); Source File: C: \ Users \ CyBeRfOrCe \ documents \ visual studio 2010 \ Projects \ SP \ sP \ adminRegistration.aspx.cs Line: 123 Stack Trace: [NullReferenceException: Object reference not set of an object.] sP.adminRegistration.gvDetails_RowCommand(Object sender, GridViewCommandEventArgs e) in C: \ Users \ CyBeRfOrCe \ documents \ visual studio 2010 \ Projects \ SP \ sP \ adminRegistration.aspx.cs:123 System.Web.UI.WebControls.GridView.OnRowCommand(GridViewCommandEventArgs
For more detail info about its properties , password recovery etc refer below link http: / / quickstarts.asp.net / QuickStartv20 / aspnet / doc / ctrlref / login / login.aspx Hi, here is sample code for login control UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI. Page { protected void Page_Load( object sender, EventArgs e) { if (!IsPostBack) Session[ "maxlogin" ] = 0; if (Request.Cookies object sender, EventArgs e) { rmembermeFlag = 1; } } what rmembermeFlag? and int count = validateUser(loginname, pass)? I declare a variable rmembermeFlag: int rmembermeFlag = 0; Left int count = validateUser (loginname, password), I do not know how to write. I use Visual studio 2010 Utimate and it is an error: "The name validateUser doesn't exit in the current context. hope your car to help