Brijesh81 Posted July 3, 2003 Posted July 3, 2003 (edited) 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. Edited July 3, 2003 by Brijesh81 Quote
Administrators PlausiblyDamp Posted July 3, 2003 Administrators Posted July 3, 2003 in the codebehind declare the variable as protected, rather than private. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Brijesh81 Posted July 3, 2003 Author Posted July 3, 2003 Thank a lot!! It works now... Thanks.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.