Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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.

Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...