I have a class, which is not present in the code behind, I have declared a property, say “Name”. Now I want to access this property “Name” in the aspx page.
I know we can do that by creating another property or a string variable or a hidden field in the code behind page and setting the “Name” properties value to it and accessing this new property/variable/ hidden field using <%= %> in the aspx page.
But I don’t want to go by the above approach.
So is there any other way.
You could add a property on your code behind which will hold a reference to your class:
and then in the aspx page you could access this property: