Question: Is there any way to directly access a field of class in the aspx page? 

I have tried this:

In the aspx page I have added:

```
<form id="LoginForm" runat="server">       
    <asp:Label Text='<%# Eval("Test") %>' runat="server" ID="jym" />
</form>        

```

and in the backend class of this page I have declared a property as:

```
private string test;
public string Test {
    get {
        return test;
    }
    set {
        test = value;
    }
}

```

This property is initialized in `Page_Load()` as: `Test = "JYM";`

But the problem is I am unable to see this value in the browser. The tag is rendered into `<span/>` but without any content. 

What I am doing wrong?

Answer: 
Are you calling `Page.DataBind()` in `Page_Load()`?

You are using the `#` data binding operator in your embedded code block. The values that you bind to the control will only show after you have called `DataBind()` from either the control or the page (which will in turn call it for each control on the page).

If you only want to bind a value to that single label control you could just call `jym.DataBind()`.

I would however suggest using a more descriptive name (id) for the Label control so it is clearer in the code about what is being databound.

See [this page](http://support.microsoft.com/kb/307860#1a) for more details.

**UPDATE** (extra info requested by OP in comment)

So you have 3 options:

1.
Call DataBind() as suggested above.

2.
Don't use a server side control for the label. Just use plain HTML and then you can use the following syntax:

```
<p><%= Test %></p>

```

3.
Set the value of the label in the code behind. For example in your page load you might have the following:

```
protected void Page_Load(object sender, EventArgs e)
{
    jym.Text = Test;
}

```
You may want to use <%= this.Test%>. You can also do this.jym.Text=Test; in the Page Load evt.