What do we have in asp.net C# like JAVA BEAN CLASS?

Hello

Can anyone tell me if we have anything like JAVA BEAN in C#.NET using ASP.NET?

You know with java bean if we construct one object in one page we can use its properties in any pages in JSP

what is the technical term of same thing in C#.NET with ASP.NET. I mean i need a class constructor which will hold some value and hat value can be retrieved from any pages in asp.net.

example…

if we have 3 pages like 1.aspx, 2.aspx and 3.aspx and one dll file my.dll which have myClass{}

in 1.aspx i define

myClass my=new myClass();
my.name=“Evan”

now in 2.aspx i want this…

<b>my.getName</b>

in 3.aspx i need the same thing

i dont want to use session here can you please tell me how i can do this???

i

I’ve never tried this with a web app but would it work if you had a class which you assigned these to the instance properties of a class

e.g.


static class Properties
{
	    private static SqlConnection _name;
        public static SqlConnection Name
        {
			set { _name = value; }
            get { return _name ; }
        }
}

it shouldnt work this class does have its own property so when you will try to set value where you will set that???

i was really looking for some answer

Ahh sorry i was half asleep while i was copying/modifying this code


static class Properties
{
	    private static string _name;
        public static string Name
        {
			set { _name = value; }
            get { return _name ; }
        }
}

would be the correct code - surely you could then just assign to it via

Properties.Name = “name here”;

and then call it using

Properties.Name

or in your case (don’t quote me on this, it’s been a while since i’ve used asp.net)

<b><? bind(Properties.Name) ?></b>

inverse.chi :x

as u r woking with asp.net so please help with my question about the topic subject do we have anything like java bean in asp.net???

Sorry, i dont think i understand enough about programming to answer your question. i dont know about serialization yet. good luck with finding a solution.

Judging from what you want

you might want to look at :