473,322 Members | 1,403 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,322 software developers and data experts.

How to execute a control defined within the content

Hi,

I have following problem :

My .aspx file contains following html code :

<table id="t1" cellspacing="0" cellpadding="0" runat="server">
<tr>
<td id="HTMLHolder" runat="server">
</td>
</tr>
</table>

The code-behind file fills the HTMLHolder with some text coming from a
database.
content = "This is an example of a link : <myTag:myLink id=test
runat="server">Go to homepage</myTag:myLink>"
HtmlHolder.Controls.Add(New LiteralControl(content))

How can I make the myTag:myLink class to execute ?

(btw... I'm quite new to ASP.NET, so give me some credit)
Jill

Nov 18 '05 #1
2 1129
Don't put your control in your content string. Try doing it this way.
content = "This is an example of a link : "
dim myTag as New MyLink
myTab.Text = "Go to homepage"
HtmlHolder.Controls.Add(New LiteralControl(content))
HtmlHolder.Controls.Add(myTag)

(note you will have to play with the sytanx a bit to get it right as this is
off the top of my head)

The idea here is that you add your text as a LiteralControl and then add
your link as an object.

-Stanley

"Jill Graham" <ji**********@yahoo.com.au> wrote in message
news:e2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have following problem :

My .aspx file contains following html code :

<table id="t1" cellspacing="0" cellpadding="0" runat="server">
<tr>
<td id="HTMLHolder" runat="server">
</td>
</tr>
</table>

The code-behind file fills the HTMLHolder with some text coming from a
database.
content = "This is an example of a link : <myTag:myLink id=test
runat="server">Go to homepage</myTag:myLink>"
HtmlHolder.Controls.Add(New LiteralControl(content))

How can I make the myTag:myLink class to execute ?

(btw... I'm quite new to ASP.NET, so give me some credit)
Jill


Nov 18 '05 #2
Hi Stanley,

Thanks for your answer, but this isn't possible in this case.
The content text is built by some end-user who uses an html-editor. He can
enter his text combined with links to other pages and/or documents. And
these links should be verified once the page is built dynamically.

Jill

"Stanley" <we*******@nospam-glass-images.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Don't put your control in your content string. Try doing it this way.
content = "This is an example of a link : "
dim myTag as New MyLink
myTab.Text = "Go to homepage"
HtmlHolder.Controls.Add(New LiteralControl(content))
HtmlHolder.Controls.Add(myTag)

(note you will have to play with the sytanx a bit to get it right as this is off the top of my head)

The idea here is that you add your text as a LiteralControl and then add
your link as an object.

-Stanley

"Jill Graham" <ji**********@yahoo.com.au> wrote in message
news:e2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have following problem :

My .aspx file contains following html code :

<table id="t1" cellspacing="0" cellpadding="0" runat="server">
<tr>
<td id="HTMLHolder" runat="server">
</td>
</tr>
</table>

The code-behind file fills the HTMLHolder with some text coming from a
database.
content = "This is an example of a link : <myTag:myLink id=test
runat="server">Go to homepage</myTag:myLink>"
HtmlHolder.Controls.Add(New LiteralControl(content))

How can I make the myTag:myLink class to execute ?

(btw... I'm quite new to ASP.NET, so give me some credit)
Jill



Nov 18 '05 #3

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

Similar topics

0
by: Ron Vecchi | last post by:
Hello, Through using this and many other Microsoft dotnet newsgroups I have been pointed towards many helpful open source projects and articles that have helped a great deal in my studies as...
7
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim...
7
by: Samuel | last post by:
Hi, I am building a page that makes use of user control as a templating technique. The following is that I have in mind and it is actually working: Root/ -- login.aspx -- login.aspx.vb --...
7
by: Ronald S. Cook | last post by:
Thanks for reading this... Our current Win app employs a ListView control wherein the tag for an item is, for example, "ContentManager.DataModel.PowerPointContent". The following code exists...
5
by: Siva | last post by:
Hello I have a dropdownlist inside the gridview as a template column defined as follows: <asp:TemplateField HeaderText="Choose Location"> <ItemTemplate> <asp:DropDownList ID="ddlChooseLoc"...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
8
by: Tomasz J | last post by:
Hello developers, After migrating my web project application (using the old model) to .Net Framework 3.5 and Ajax Control Toolkit release 20820 the Accordion control no longer works correctly....
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.