Extremely Urgent !! Access CodeBehind variable in Aspx

Brijesh81

Active member
Joined
Jul 2, 2003
Messages
25
Location
New Delhi
Hi,

I have defined a variable in my CodeBehind and I want to access it in Aspx. Is it possible...

I have tried as below to populate a label control.
What is wrong with this??

1) <asp:Label id="Label3" runat="server" Width="100px" EnableViewState="True"><%=base.GetTestVal()%></asp:Label>

In the above code, GetTestVal2 is a public method defined in my codebehind, it returns an string value

2) <asp:Label id="Label2" runat="server" Width="100px" EnableViewState="True"><%=base.testval%></asp:Label>

In the above code, testval is an string type static variable in my codebehind.

None of the above works. No value is displayed in the label.

Please Help. This is extremely urgent.
 
Last edited by a moderator:
Back
Top