.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Asp.net class with example

Posted By: Naresh     Posted Date: December 17, 2010    Points:2   Category :ASP.Net
hi,

Could any one explain me with example about asp.net classes and how can those classes can be called in asp.net webpages. I need the coding in C#.net



Thanks


Responses
Author: Syed Shakeer Hussain             
Posted Date: December 18, 2010     Points: 5   

Hi,
First Create a Class.by using Add NewItems.

Public Class SampleClassName
{

Public int Method1(int a,int b)
{
int c=a+b;
return c;
}
}


In webPage:

If you want to call the Above function pass the values as follows in Button click Event:

//Creating the object of a SampleClassName as follows

SampleClassName obj=new SampleClassName();

textBox.Text=Convert.ToString(obj.Method1(10,20));



Author: bordas             
Posted Date: December 18, 2010     Points: 5   








<a href="http://www.cosavings.com"rel="dofollow">Regular Savings Accounts</a>



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend