Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data binding not working

Status
Not open for further replies.

bbxrider

Programmer
Sep 23, 2008
18
US
this is the code on the .aspx page for the control
Code:
<asp:TextBox id="someID" maxlength="10" columns="10" runat="server" Text="<%# work %>" />
then the variable declaration in the code behind, the variable is definitely populated before the page renders but the control comes up blank
Code:
Public Shared work As Integer
work = 987654321
I used this ms kb article as a source of course it all looks so simple. I'm wondering if there is some specific way the variable has to be declared. or some directive for the page? or ?????????????????
 


Since your control is not part of a data control (GridView, FormView, etc.) you'll have to call Page.DataBind() expicitly. You can put it in your Page_Load event

Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Page.DataBind()
            .
            .


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top