Need help on creating a dynamic page. - We use Master Pages and this is how I am trying.

L

Learner

Hello,
We use Master Pages in our website and need a page to be created
dynamically. I am not sure where I am missing but I don't see any error
and the controls on the page either!

Here is my dynamicpage.aspx page

*********************************************************************************************************
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
AutoEventWireup="false" CodeFile="DynamicPage.aspx.vb"
Inherits="DynamicPage" title="Untitled Page" %>

<asp:Content ID="Content3" ContentPlaceHolderID="_ContentHolder"
Runat="Server">
</asp:Content>


*********************************************************************************************************

here is my complete code of a simple code that supposdly display a
TextBox

**************************************Code behind page
*************************************
Partial Class DynamicPage
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents ctntplaceHolder As ContentPlaceHolder

Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Init
ctntplaceHolder =
CType(Page.Master.FindControl("_ContentHolder"), ContentPlaceHolder)
TextBox1 = New TextBox()
TextBox1.ID = "TextBox1"
TextBox1.Style("Position") = "Absolute"
TextBox1.Style("Top") = "25px"
TextBox1.Style("Left") = "100px"
TextBox1.Visible = True
ctntplaceHolder.Controls.Add(TextBox1)
ctntplaceHolder.Visible = True
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
TextBox1.Text = "TextBox1"
End If

End Sub
End Class

*******************************************End of code
behind**************************************

Can some one please help me if I am missing some thing here? the code
runs with no errors but it doesn't display my TextBox either :(

Thanks in advance,
-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top