I'm modifying the small business starter kit and I'd like to have a mailto specific to that page (specific item). I was ideally looking for a simple line of code that would insert the item number in the subject line of the email.
<a href="mailto:test@yahoo.com?subject=<%# Eval ("ID").ToString() %>">send message about this product</a> does not work. Any ideas? Would a string work? How would that be coded?
This worked. One major mistake I was making was putting it after the item template and thus it had already finished running. Thanks to you all for helping me get my brain around what I was
doing wrong. It takes a village.
Marked as answer by leftfield on Nov 22, 2008 04:56 PM
leftfield
Member
3 Points
13 Posts
mailto & subject in small business starter kit
Nov 17, 2008 03:32 PM|LINK
I'm modifying the small business starter kit and I'd like to have a mailto specific to that page (specific item). I was ideally looking for a simple line of code that would insert the item number in the subject line of the email. <a href="mailto:test@yahoo.com?subject=<%# Eval ("ID").ToString() %>">send message about this product</a> does not work. Any ideas? Would a string work? How would that be coded?
Sagar Nishan...
Participant
942 Points
152 Posts
Re: mailto & subject in small business starter kit
Nov 18, 2008 10:51 AM|LINK
Try with single quotes for ID...
<a href="mailto:test@yahoo.com?subject=<%# Eval ('ID').ToString() %>">send message about this product</a>
Nishant Sagar
leftfield
Member
3 Points
13 Posts
Re: mailto & subject in small business starter kit
Nov 18, 2008 01:08 PM|LINK
Compiler Error Message: CS1012: Too many characters in character literal
Line 103: <a href="mailto:test@yahoo.com?subject=<%# Eval ('ID').ToString() %> ">send a message about this product.</a>
leftfield
Member
3 Points
13 Posts
Re: mailto & subject in small business starter kit
Nov 18, 2008 01:22 PM|LINK
<%
# "mailto:test@yahoo.com?subject="+ Eval ("ID").ToString() %>send a message about this product.Horizon
Member
155 Points
79 Posts
Re: mailto & subject in small business starter kit
Nov 19, 2008 01:57 PM|LINK
This should work....You just have to be inside the repeator control that is cycling through the data.
<a href="mailto:test@yahoo.com?subject=<%# Eval("Id") %>">leftfield
Member
3 Points
13 Posts
Re: mailto & subject in small business starter kit
Nov 20, 2008 06:40 PM|LINK
I got it!
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "mailto:test@yahoo.com?subject="+ Eval("Title") %>'>I'd like more information about this product.
</asp:HyperLink> </ItemTemplate> </asp:TemplateField>This worked. One major mistake I was making was putting it after the item template and thus it had already finished running. Thanks to you all for helping me get my brain around what I was doing wrong. It takes a village.