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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web control

Status
Not open for further replies.

critical5

Programmer
Dec 13, 2006
37
GB
Hi I have been trying to programmatically add a label on my page but wont work:

Here is the code I am using:

<%@page Language="VB"%>

<script runat="server">
Private Sub page_load()
Dim genericlabel As Label
genericlabel = New Label()
Dim panel1 As Panel
panel1 = New Panel()
panel1.Controls.Add(genericlabel)
genericlabel.Text = "Credit Report: "
End Sub
</script>
<html xmlns="<head>
<title></title>
</head>

<body>

</body>
</html>

Could somebody tell me where I am going wrong please?

Thanks
Critical5
 
You've created a New Label and added it to a New Panel. However, the Panel hasn't been added to the page...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Do I add this panel manually or programmatically...could you show me the syntax?

Thanks


Critical5
 
You can add the panel through the IDE or in code.

could you show me the syntax?
You already wrote the syntax for the label. Just add the panel control to the page object.
Page.Controls.Add(your panel)
 
thanks....I was being stupid...I have done it...thanks again
Thia forum rocks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top