473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Insert controls into output HTML (DotNetNuke style)

I am trying to get a control to insert into the HTML content for a page
which comes from our database. At the point I have a tag for the component I
want to add which is contained inside the HTML. I have tried to insert the
control into a placeholder with no joy. I want to have something similar to
DotNetNukes way of adding content to a page.

Does anyone have any ideas how to do this or where I'm going wrong?

What I have so far : (there are no errors it just doesnt appear)

PlaceHolder LanguageBarPlaceHolder2;

protected void Page_Load(object sender, EventArgs e)

{

LanguageBarPlaceHolder2 = new PlaceHolder();

Literal1.Text = "<html><body><div>";

Literal1.Text += @"<asp:PlaceHolder ID=""LanguageBarPlaceHolder2""
runat=""server""></asp:PlaceHolder>";

Literal1.Text += "Test</div></html></body>";

LanguageBarPlaceHolder2.Controls.Add(LoadControl(" ~/Controls/LanguageBar.ascx"));

}
Feb 14 '07 #1
1 1778
In article <u6**************@TK2MSFTNGP06.phx.gbl>, jh******@msn.com
says...
I am trying to get a control to insert into the HTML content for a page
which comes from our database. At the point I have a tag for the component I
want to add which is contained inside the HTML. I have tried to insert the
control into a placeholder with no joy. I want to have something similar to
DotNetNukes way of adding content to a page.

Does anyone have any ideas how to do this or where I'm going wrong?

What I have so far : (there are no errors it just doesnt appear)

PlaceHolder LanguageBarPlaceHolder2;

protected void Page_Load(object sender, EventArgs e)

{

LanguageBarPlaceHolder2 = new PlaceHolder();

Literal1.Text = "<html><body><div>";

Literal1.Text += @"<asp:PlaceHolder ID=""LanguageBarPlaceHolder2""
runat=""server""></asp:PlaceHolder>";

Literal1.Text += "Test</div></html></body>";

LanguageBarPlaceHolder2.Controls.Add(LoadControl(" ~/Controls/LanguageBar.ascx"));

}
I would try using the RenderControl method on the PlaceHolder control to
get it's content.

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 14 '07 #2

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

Similar topics

1
by: Jax | last post by:
I am looking to populate web page with controls as a result of a database query. eg (pseudocode) <% foreach(Garment g in GetStuffFromDB()) { //add controls Response.Write("<asp:Button id =...
5
by: TPS | last post by:
When I set trace enable to true in my web.config file, the debug info does not display at the "bottom" of the page, it displays "under" all of my buttons, labels, grids etc. This behavior...
6
by: Sean | last post by:
HI There, I am making the transition from asp to asp .net, I am currenty writing an application that requires a bulk insert from a webform into SQL server, normally I would just create rows of...
2
by: Sky Sigal | last post by:
Hello: I'm currently messing around, and need as much feedback/help as I can get, trying to find the most economical/graceful way to build usercontrols that rely on styling to look any good... ...
4
by: Marius Trælnes | last post by:
Hello! I am about to make a class/control that creates tabbing functionality. The result is in HTML/CSS/JavaScript output. My question is: Within the tabs I want to simply add user controls...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
6
by: AG | last post by:
ASP.NET 2.0 aspx page with a FormView bound to an ObjectDataSource to view, add and edit records. Can anyone point me to a sample of how to retain the user entered control values when an insert...
3
by: superbee76 | last post by:
Staying with in the DotNetNuke 3.2 framework I'm attempting to find the best, simplest solution for making callbacks/RPCs/Ajax requests. The biggest obsticles seem to be staying within the...
4
by: Scott M. | last post by:
I'm not sure where I should be placing the code that creates my literal controls. They are rendering but AFTER the close of the HTML tag. I've tried Load, Init, PreLoad, PreInit, PreRender and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.