473,624 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control - takes HTML as parapeter

How do I write a user control that takes HTML and then renders it? Is it
possible? I want to do something like this..

<Name:Box id="mybox" runat="server">

<table>
.... any html can inserted in here....
</table>

</Name:Box>

Nov 19 '05 #1
3 1048
Why not just expose a string property that takes the html you want?

Throw a literal control in between your table tags and set it with the value
of your property.

"00_CuMPe3WaR3D 12" <00************ **@yahoo.com> wrote in message
news:4b******** ************@ro gers.com...
How do I write a user control that takes HTML and then renders it? Is it
possible? I want to do something like this..

<Name:Box id="mybox" runat="server">

<table>
.... any html can inserted in here....
</table>

</Name:Box>

Nov 19 '05 #2
Actually to be exact, I need more than PLAIN Html I want to have a form
(or other controls) to be put between my Control. In other words, it is a
question of "How do I put a control under a User/Web Control. Sorry I wasn't
being clear enough....

<Name:Box id="mybox" runat="server">
<form id="myform" runat="server">
.....
</form>
</Name:Box>

"Jason MacKenzie" <te**@c.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Why not just expose a string property that takes the html you want?

Throw a literal control in between your table tags and set it with the value of your property.

"00_CuMPe3WaR3D 12" <00************ **@yahoo.com> wrote in message
news:4b******** ************@ro gers.com...
How do I write a user control that takes HTML and then renders it? Is it
possible? I want to do something like this..

<Name:Box id="mybox" runat="server">

<table>
.... any html can inserted in here....
</table>

</Name:Box>


Nov 19 '05 #3
I think i found a solution by setting ParseChildren to false

[ParseChildren(f alse)]

thanks.
"00_CuMPe3WaR3D 12" <00************ **@yahoo.com> wrote in message
news:Xp******** ************@ro gers.com...
Actually to be exact, I need more than PLAIN Html I want to have a form
(or other controls) to be put between my Control. In other words, it is a
question of "How do I put a control under a User/Web Control. Sorry I wasn't being clear enough....

<Name:Box id="mybox" runat="server">
<form id="myform" runat="server">
.....
</form>
</Name:Box>

"Jason MacKenzie" <te**@c.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Why not just expose a string property that takes the html you want?

Throw a literal control in between your table tags and set it with the

value
of your property.

"00_CuMPe3WaR3D 12" <00************ **@yahoo.com> wrote in message
news:4b******** ************@ro gers.com...
How do I write a user control that takes HTML and then renders it? Is it possible? I want to do something like this..

<Name:Box id="mybox" runat="server">

<table>
.... any html can inserted in here....
</table>

</Name:Box>



Nov 19 '05 #4

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

Similar topics

0
1404
by: Nick Wright | last post by:
Hi, I have some business logic in a system that I can't change. The business logic returns a recordset containing HTML. I have an ASP.NET web page with two user controls one is a header, the second user control is looping through the recordset outputing the HTML with response.write...
4
1355
by: Andrea Williams | last post by:
I'm trying to set up a user control and change some values from the aspx page, but I keep running into trouble. What I really would like to do is be able to set a Label.Text in the user control from an aspx page. If I open up a static method to set the Label in the code-behind of the user control(uc), then the code in the uc doesn't recognize that the label exists (only if the method is a static (shared) method). If I set up a private...
3
2262
by: Eric | last post by:
I have built a composite user web control that I want to create dynamically. The form will contain a variable number of these controls and as well some of the contents of the user web control itself are dynamically created controls. I create as follows: wcGroupControl oGroupControl = new wcGroupControl(); I then tried calling methods of the control passing dynamic controls as parameters that need to be added to the web controls on the...
7
2934
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have some insight about. 1) It takes 20 sec or so to open a tcp socket from the client to the server. It just sits in the TcpClient.conect waiting for something. When I run the same control from a windows application it connects right away and works...
6
3366
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display the user control - select user control button, event fires - select web form button to display...
8
2257
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing happens. dim filt as string ... build filter string... UserControl.ReportFilter = filt
0
1560
by: Rick Wez | last post by:
I feel like I'm going to pull out my hair (there's not much left); I've read almost every online post trying to figure this out. So I started over with something VERY simple and it still doesn't work ... here we go. I have a datalist with an embedded user control. My user control outputs a single string. The first time thru, everything works perfectly ... on a postback, the datalist gets it's values correctly, but the user control does...
11
2122
by: Brad Baker | last post by:
I'm building a small web application - I started out placing all my code in one file (config.aspx). As I continue to add code though it was becoming very unwieldy. After doing some searching online I found an article which suggested I might place some of the code into web user controls. I created two new files (general_info.ascx and store_front.ascx) and placed two chunks of code in each. I then registered the controls at the top of...
3
2514
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a user control which I use on all my pages. The control is situated on the top of my page (sits on my master page). For some long pages the user has to scroll back up to the top of the page to select an option from my user control. Can I make this user control floatable so that as the user scrolls down the page the user control moves down also?
0
8174
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
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
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
7164
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
5565
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
4082
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
2607
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
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1485
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.