Get a reference to a LiteralControl from the page's base class

I've got a LiteralControl on my aspx page. The aspx page inherits from a base class (which inherits from System.Web.UI.Page). I want to set the Text property of the LiteralControl from the base class, but how do I get a reference to it? Page.FindControl returns a simple Control, which doesn't have a Text property. Thanks...
LVL 2
sumo_the_catAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ihenryCommented:
Since a control inside aspx normally declared as protected scope, you should be able to just call the variable name directly inside the inherit class.

LiteralControl1.Text = "this line is in class that inherits the base class"
0
sumo_the_catAuthor Commented:
other way round. i need to put this line in the base class!
0
ihenryCommented:
This?

Protected WithEvents MyLiteral As System.Web.UI.WebControls.LiteralControl and in page_load or override onload method and assign the LiteralControl text property to a value.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

ihenryCommented:

And in aspx page that inherits baseclass drop a literal control but remove its variable declaration.
0
sumo_the_catAuthor Commented:
I don't think that works. But I've solved the problem in a different way. Thanks for your help. Peter.
0
ihenryCommented:

I can assure you that works, I have exactly the same situation with you :0)
0
sumo_the_catAuthor Commented:
Ok, thanks! pete.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.