Custom Tags???

E

EDOnLine

Is it possible to create Custom Tags in HTML and have ASP.NET replace these
custom tags with info from my database before the page is returned to the
client?

For example.... In an aspx file I would have plain HTML along with a custom
tag like this....
<p>Some text here. Email <MAIL:221>Web Master</MAIL> for more
information.</p>

The <MAIL> Custom Tag would be replaced with a mailto: link based on
information in record 221 in my Employee database.

How can this, or something similar, be done???

Thanks in advance for any information!

-- Eric D.
 
G

Guest

You could create a custom server control and one of the attributes could be
your 221 value. So this would look like...

<MyTools:Mail record="221"></MyTools:Mail>

Check the .NET tutorials on creating a custom server control and they will
explain how to do this.

Philip
 
E

e

Here's something similar, but it doesn't use custom tags:

<p>Some text here. Email <asp:Hyperlink id="dbmail221"
runat=server></asp:Hyperlink> for more information.</p>

On page_load, for-each through the controls collection, watch the names for
'dbmail'; parse the trailing number into <recordnum>, and complete the
controls properties based upon employee record number <recordnum>.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top