473,322 Members | 1,241 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 put asp tag INSIDE html tag

Sorry to waste your time with such an elementary question but I can't
remember how to do this and my search for an answer on the web has
been fruitless so far.

How do you put an asp code inside an html tag?

This is not working:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

More info: I am actually putting above info in an Access field. People
would be able to send me email through a form in contact.asp and I
want the subject line reflect which page they came from.

thanks. crispy
Jul 19 '05 #1
14 12121
You can't use ASP in .html pages...... you'll need an .asp page for that.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
crispy <> <polaatx@ REMOVE THIS yahoo.com> wrote in message
news:c8********************************@4ax.com...
Sorry to waste your time with such an elementary question but I can't
remember how to do this and my search for an answer on the web has
been fruitless so far.

How do you put an asp code inside an html tag?

This is not working:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

More info: I am actually putting above info in an Access field. People
would be able to send me email through a form in contact.asp and I
want the subject line reflect which page they came from.

thanks. crispy

Jul 19 '05 #2
> Sorry to waste your time with such an elementary question but I can't
remember how to do this and my search for an answer on the web has
been fruitless so far.

How do you put an asp code inside an html tag?

This is not working:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

More info: I am actually putting above info in an Access field. People
would be able to send me email through a form in contact.asp and I
want the subject line reflect which page they came from.

thanks. crispy


Tell IIS to treat .html extension as ASP files.
Jul 19 '05 #3
freaky friday <fr****@friday.net> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
<snip>

Tell IIS to treat .html extension as ASP files.


It'll do that??

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #4
I AM using asp pages, of course.

Perhaps I didn't make myself clear:

Visitors would click on the following link in an asp page:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

My problem is simply how to code the
(Recordset1.Fields.Item("group_name").Value) inside the <a> tag. The
above string doesn't work.

So again, how do you put asp code INSIDE an html tag?

crispy

On Sat, 27 Dec 2003 16:45:18 -0000, "Steven Burn"
<nobody@PVT_it-mate.co.uk> wrote:
You can't use ASP in .html pages...... you'll need an .asp page for that.


Jul 19 '05 #5
Sure, you can use .ray extensions if you want. :]

Ray at home

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:eo**************@TK2MSFTNGP10.phx.gbl...
freaky friday <fr****@friday.net> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
<snip>

Tell IIS to treat .html extension as ASP files.


It'll do that??

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Jul 19 '05 #6
hehe, I knew about custom extensions, just didn't know you could manipulate
IIS to treat HTML files as ASP files. (I'm fairly new to IIS myself, having
only just gotten XP)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Ray at <%=sLocation%> <myFirstNameATlane34dotKOMM> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Sure, you can use .ray extensions if you want. :]

Ray at home

"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:eo**************@TK2MSFTNGP10.phx.gbl...
freaky friday <fr****@friday.net> wrote in message
news:#8**************@TK2MSFTNGP12.phx.gbl...
<snip>

Tell IIS to treat .html extension as ASP files.


It'll do that??

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Jul 19 '05 #7
> above string doesn't work.

Could you define "doesn't work" for us? What is in the value? What shows
up in the status bar when you mouse over it? What do you see in view
source? What happens when you click on the link?

I hope you don't call your doctor and tell him "I'm broken," expecting a
quick fix. He's going to require more information, and so are we.
Jul 19 '05 #8
"crispy <>" wrote:
I AM using asp pages, of course.
But, of course.
Perhaps I didn't make myself clear: Agreed.
Visitors would click on the following link in an asp page:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>
No they wouldn't. They will never see <% %> anything.

However, you're probably looking at your ASP source. The source the client
sees is different. ASP processing has already taken place.

<%
dim groupName
groupName = Recordset1.Fields.Item("group_name").Value
%>
<a href="contact.asp?subject=Question about group <%=groupName%>">Send a
message </a>

If the group name was BUSINESS then the client would see ONLY:
<a href="contact.asp?subject=Question about group BUSINESS">Send a
message</a>

Is the 1 appended to the RecordSet name the actual name of the RecordSet
(RecordSet1)?
My problem is simply how to code the
(Recordset1.Fields.Item("group_name").Value) inside the <a> tag. The
above string doesn't work.

So again, how do you put asp code INSIDE an html tag?


<%=someVariable%>
or
<%=rs("some_field")%>

The value will be presented to the client where the ASP code is in the ASP
source file.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
Jul 19 '05 #9
This is one way:

<% x = (recordset1.fields.item("group_name").value)%>
<a href="contact.asp?subject=Question about group <%= x%>">send a
message</a>

This works. if you have any questions, email me at
im***********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #10
"crispy <>" <polaatx@ REMOVE THIS yahoo.com> schrieb im Newsbeitrag
news:c8********************************@4ax.com...
How do you put an asp code inside an html tag?


Your anchor tag will not work, because the quotes are not properly nested.
If you look at your own code,...

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

you will see that the quote after href= is matched by the quote before
group_name. A better way to code the above would be...

<a href='contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>' >Send a message</a>

or I would prefer something more readable like...

<%
Dim strGroupName
strGroupName = Recordset1.Fields.Item("group_name").Value
%>
<a href='contact.asp?subject=Question about group
<%=strGroupName%>'>Send a message</a>

Michael G. Schneider
Jul 19 '05 #11
> <a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

you will see that the quote after href= is matched by the quote before
group_name.


That's not true. Have you actually tried the code? The quote before
group_name is evaluated in ASP, long before the actual tag is written to the
browser.
Jul 19 '05 #12
"freaky friday" <fr****@friday.net> schrieb im Newsbeitrag
news:uV**************@TK2MSFTNGP11.phx.gbl...
That's not true. Have you actually tried the code? The quote before
group_name is evaluated in ASP, long before the actual tag is written to the browser.


Of course you are true. I was probably sleeping. Sorry.

Michael G. Schneider
Jul 19 '05 #13
Did you ever get a useful answer?

The code you have looks valid to me. What is the output you did get?

Tom B
"crispy <>" <polaatx@ REMOVE THIS yahoo.com> wrote in message
news:c8********************************@4ax.com...
Sorry to waste your time with such an elementary question but I can't
remember how to do this and my search for an answer on the web has
been fruitless so far.

How do you put an asp code inside an html tag?

This is not working:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

More info: I am actually putting above info in an Access field. People
would be able to send me email through a form in contact.asp and I
want the subject line reflect which page they came from.

thanks. crispy

Jul 19 '05 #14
Yes, Tom. I finally got it in my head that I need to dim the recordset
value BEFORE i call on it. Thanks to all who responded and again I
apologize for my slow learning. crispy
On Mon, 29 Dec 2003 11:28:40 -0500, "TomB" <sh*****@hotmailXXX.com>
wrote:
Did you ever get a useful answer?

The code you have looks valid to me. What is the output you did get?

Tom B
"crispy <>" <polaatx@ REMOVE THIS yahoo.com> wrote in message
news:c8********************************@4ax.com.. .
Sorry to waste your time with such an elementary question but I can't
remember how to do this and my search for an answer on the web has
been fruitless so far.

How do you put an asp code inside an html tag?

This is not working:

<a href="contact.asp?subject=Question about group
<%=(Recordset1.Fields.Item("group_name").Value)%>" >Send a message</a>

More info: I am actually putting above info in an Access field. People
would be able to send me email through a form in contact.asp and I
want the subject line reflect which page they came from.

thanks. crispy


Jul 19 '05 #15

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

Similar topics

2
by: sams | last post by:
How do I make or workaround in my Apache server to parse *.html files for <?php ?> code embedded in it? Currently php recognises <?php ?> tag only if the file has a *.php extension. Any php...
3
by: crispy | last post by:
Hello group, I'm again having trouble putting ASP records INSIDE html link. Here's the string I put inside Access field: No room number specified (<a...
14
by: Reply Via News Group Please | last post by:
Folks, I'm new to CSS and realise that by posting in the html newsgroup, I might upset one or two readers by raising a CSS question in an html newsgroup however my ISP only has one small CSS...
15
by: Matthias Hullin | last post by:
Hi, I'm programming some PHP discussion board that is supposed to appear inside the content area of a proprietary CMS. As I need some more styles than the standard stylesheet provides, I just...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be followed...
3
by: SMH | last post by:
Normally an SVG document is loaded/parsed/interpreted inside an HTML document using an 'object' (or 'embed') element, although there are supposedly other ways too. The problem is, the SVG document...
1
by: countocram | last post by:
I have big problem, I'm using preg_replace() function for my highlighter function, after searching for particular keyword, once the hightler check box is checked it will highlight the content that...
4
by: rotorio | last post by:
Hi, i have a little problem. I can't make it work: <a href="blabla.php" style="hover:color:red;">blablabla</a> How to type this hover property inside html tag correctly? Yes I know how it works...
0
by: Aravind555 | last post by:
Hi How to get particular value from inside html code of a existing internet explorer page from excel macro (navigate the page by using app activate or any other with out using web query but by...
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
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.