T
Tascien
Guys,
I am trying to run through the page controls, if the controls' id is
found in the database, then I change the corresponding text from the
database. but, the system is coming back with error:
BC30456: 'Text' is not a member of 'System.Web.UI.Control'.
how. I am sure the label control has a text property.
here is my function:
function showControls()
Dim c as control
for each c in page.controls
response.Write(c.ID & "<BR>") <-- this works...
c.Text = "I have been changed" <-- this fails ! why?
testme.Text = "I have been changed"
next
End Function
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<script language="VB" runat="server">
Sub Page_Load(Sender as Object, e as EventArgs)
showControls()
End sub
function showControls()
Dim c as control
for each c in page.controls
response.Write(c.ID & "<BR>")
c.Text = "I have been changed"
testme.Text = "I have been changed"
next
End Function
</script>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<asp:label ID="testme" Text="I am here" runat="server"/>
</body>
</html>
I am trying to run through the page controls, if the controls' id is
found in the database, then I change the corresponding text from the
database. but, the system is coming back with error:
BC30456: 'Text' is not a member of 'System.Web.UI.Control'.
how. I am sure the label control has a text property.
here is my function:
function showControls()
Dim c as control
for each c in page.controls
response.Write(c.ID & "<BR>") <-- this works...
c.Text = "I have been changed" <-- this fails ! why?
testme.Text = "I have been changed"
next
End Function
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<script language="VB" runat="server">
Sub Page_Load(Sender as Object, e as EventArgs)
showControls()
End sub
function showControls()
Dim c as control
for each c in page.controls
response.Write(c.ID & "<BR>")
c.Text = "I have been changed"
testme.Text = "I have been changed"
next
End Function
</script>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<asp:label ID="testme" Text="I am here" runat="server"/>
</body>
</html>