Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (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 by Brijesh81

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...