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
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