yahya Posted November 3, 2003 Posted November 3, 2003 Hi.......everyone. This is my first appearance.... As I am also a fresher in ASP.NET technology I am struck with which I think is also basic. Is there any way in ASP.NET wherein I can write certain functions related to my Web application seperately and include it in my webform as though I have written it in my webform. I heard some people saying that I will have to create a Module. I dont know what that Module means... Can any one in this board help me? Quote
bungpeng Posted November 3, 2003 Posted November 3, 2003 I will suggest you use class rather than module. and use "Shared" for your functions. Normally we need to define the object for a class in order to use it's function, but for "Shared" function, you can use it directly without creating object. Quote
yahya Posted November 3, 2003 Author Posted November 3, 2003 Not working...!!!!! Hi...bungpeng Thanks for your suggestion. I had been searching for a solution of this kind since last week. I tried creating a class with a Shared function in c#. But it throws an error saying : "D:\oopstest\banner.cs(17): The type or namespace name 'Shared' could not be found (are you missing a using directive or an assembly reference?)" I have just copied the code below: using System; namespace oopstest { /// <summary> /// Creates table to display banner /// </summary> public class banner { public banner() { // // TODO: Add constructor logic here // } public Shared myName() { return thename; } } } Any clue? Quote
Administrators PlausiblyDamp Posted November 3, 2003 Administrators Posted November 3, 2003 Shared is a VB.Net keyword - use static under C#. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
yahya Posted November 3, 2003 Author Posted November 3, 2003 Thank you PlausiblyDamp. I will try this out. :-) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.