473,799 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 LanguageBarPlac eHolder2;

protected void Page_Load(objec t sender, EventArgs e)

{

LanguageBarPlac eHolder2 = new PlaceHolder();

Literal1.Text = "<html><body><d iv>";

Literal1.Text += @"<asp:PlaceHol der ID=""LanguageBa rPlaceHolder2""
runat=""server" "></asp:PlaceHolder >";

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

LanguageBarPlac eHolder2.Contro ls.Add(LoadCont rol("~/Controls/LanguageBar.asc x"));

}
Feb 14 '07 #1
1 1795
In article <u6************ **@TK2MSFTNGP06 .phx.gbl>, jh******@msn.co m
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 LanguageBarPlac eHolder2;

protected void Page_Load(objec t sender, EventArgs e)

{

LanguageBarPlac eHolder2 = new PlaceHolder();

Literal1.Text = "<html><body><d iv>";

Literal1.Text += @"<asp:PlaceHol der ID=""LanguageBa rPlaceHolder2""
runat=""server" "></asp:PlaceHolder >";

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

LanguageBarPlac eHolder2.Contro ls.Add(LoadCont rol("~/Controls/LanguageBar.asc x"));

}
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
6976
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 = 'Button'"+ctr.ToString() +"/>")
5
2025
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 happens in GridLayout, or FlowLayout. ? Thanks, TPS.
6
3190
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 html textboxes and then use the Request.Form.Count property to collect each field. What I would like to know is what is a good way of doing this in asp.net? Do I need to create an array of textboxes or can I do this fro a datagrid?
2
1418
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... It's the last part that has got me all frazzled (the 'rely on...to look good')... Let me explain -- and please bear with me as it's a bit longer than my usual questions:
4
4197
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 and without loosing viewstate etc etc. How can this be done? What is best practice? I guess the answer for my question lies in how I design/develop the tab
22
2195
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 stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of Administrator, one would be prevented from deleting a ticket not created by oneself. However, it did occur...
6
14463
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 fails? In other words, when inserting a new record, user enters data in the controls, but the insert fails. When the page posts back all the controls are empty or at their default values. I would like to retain the user enter values so they can...
3
2648
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 DotNetNuke framework recommendations: *** 1. Default.aspx - One page, one entry point Staying with this is great because it handles security for
4
1461
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 get the same result each time: Example code: Controls.Add(New LiteralControl("<div>")) Dim lblItem As New Label
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10482
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10225
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
10027
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
6805
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
5463
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...
1
4139
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
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.