473,796 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.asp x page

*************** *************** *************** *************** *************** *************** ***************
<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er"
AutoEventWireup ="false" CodeFile="Dynam icPage.aspx.vb"
Inherits="Dynam icPage" title="Untitled Page" %>

<asp:Content ID="Content3" ContentPlaceHol derID="_Content Holder"
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.P age
Protected WithEvents TextBox1 As System.Web.UI.W ebControls.Text Box
Protected WithEvents ctntplaceHolder As ContentPlaceHol der

Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Init
ctntplaceHolder =
CType(Page.Mast er.FindControl( "_ContentHolder "), ContentPlaceHol der)
TextBox1 = New TextBox()
TextBox1.ID = "TextBox1"
TextBox1.Style( "Position") = "Absolute"
TextBox1.Style( "Top") = "25px"
TextBox1.Style( "Left") = "100px"
TextBox1.Visibl e = True
ctntplaceHolder .Controls.Add(T extBox1)
ctntplaceHolder .Visible = True
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
If Not Page.IsPostBack Then
TextBox1.Text = "TextBox1"
End If

End Sub
End Class

*************** *************** *************En d 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

May 24 '06 #1
0 972

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1778
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement the IPageContent interface. A page (aspx) must then be created that loads (using Page.LoadControl) the page template, and the page content. The page content adds itself to the page template. The page template is then added to the aspx's control...
8
2369
by: PJ | last post by:
How can I get a reference to the master page class? It is defined as a partial class, but I cannot seem to type a variable to the name of the partial class? The compiler continually shows "The type 'MyMaster' is not defined." I would like to reference the master page from a control, by casting the Master property of the Page property to the type, but obviously I cannot do this if I can't get a reference to the actual type. Thanks,
36
3049
by: sonnystarks | last post by:
I am trying to learn HTML and have obtained several books on the subject. However, I am confused with the proper way of going about it as most of these books give me the basic tags and then say they will soon be deprecated and advise using CSS stylesheets. Which comes first? Do I learn the old tags and then "upgrade" to CSS or just bypass the old tags and learn only the CSS procedures. Doesn't one have to understand the old tags to use...
3
1574
by: sqlboy2000 | last post by:
Hi, I've just started playing around with master / detail pages and I'm trying to simply change the detail page displayed in the contentplaceholder control from code behind. I can't seem to find any examples of this. Does anyone know how to do this? Thanks in advance.
3
1926
by: Pini | last post by:
Hi all,In asp.net 1.x i creates a basepage that extends System.Web.UI.Page class. I created this file in a web appplcaition project and then refernced it from another projects. All the pages in this project inherited from this new BasePage ionstead of the Page class. In asp.net 2.0 i dont seem to make this work. I did the same thing. precompile the project and then added refernce to the assemblies in the precompiled directory.
10
4939
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're called, an example of what I have in mind is index.php?page=). However, I can not figure out how to do this. I will eventually want to use SEF urls, but for now I'll be content just to have the dynamic urls. If anyone can tell me how to do this, I'd...
5
1704
by: shapper | last post by:
Hello, In this moment I am creating all my aspx pages on my vb.code at runtime. It seems nonsense to have .aspx and .aspx.vb files in my projects. I am considering creating my pages on the fly using IHttpHandler. I already did that for delivering XML files.
0
955
by: shapper | last post by:
Hello, I am creating a web site with nested master pages. Inside of one of this master pages I added a user control. I need to access an Asp.Net Panel which is inside Global.master from my UserControl.ascx.vb. How can I do this?
6
9161
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %> On the Master Page I have a public property exposed: Public Property ErrorMessage() As String Get Return txtError.InnerText End Get
1
10200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.