Q:

Setting a local varaible on a .net user control, c#

I have a .net web form, back end in c#.  I have a user control on that form, with a single local variable on the user control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyControl.ascx.cs" Inherits="MyWebForm. MyControl" %>
<%= myvar %>

On the back end of the user control, I want to set that variable to something.  Anything, doesn't matter, a string value.  What's the easiest way to do this? 
I recognize this is a relatively simple question and it may have beeen answered already.  I did some searching on my own and could only find similar questions based on passing a variable from the parent page to the control and vice versa.  I'm not trying to do that.  Just trying to set that myvar to something.  If I need to be pointed to an existing answer, I don't mind. 

A:

If you're even able to do this:
<%= myvar %>

Then presumably myvar is a class-level member which is at least protected or possibly public?   From within any given class, you can set a class-level member:
this.myvar = "some value";

If the member is public then you can also set it from other objects where you have a reference to that object:
someObject.myvar = "some value";

In this case if myvar is a class member on the user control and the containing page has an instance of that user control as a control on that page, then the containing page would simply set that value:
MyControl1.myvar = "some value";

