Introduction:
Some Programmer’s written a common class files for accessing particular Common Method/Function throughout the application.Sometimes a particular method is needed for some 2 to 3 webpages,On that time we don’t need to written method from each and every page.We can easily access the method or function from One page to another.
Main:
Before starting,please make sure the both webpages coming under same namespace,
for ex,
In page1,
Private static string Welcome()
{
return string.Format(“Hi,i am another page function”);
}
In page2,
Just i am going to create a class for page1,
page1 firstpage=new page1();
Response.Write(firstpage.Welcome);
That’s it!We don’t need separate class file,
Conclusion:
Hope,this helps,
Happy Coding.
1 Comments.