Click here to Skip to main content
15,887,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following line of code which works perfectly. It was written for me so it's tricky to understand exactly what is happening. It displays an image with a price overlayed on it. When you click the image, it brings up an enlargement using Nyromodal. I wish to now add a Buy Now button to the enlargement image but can't work out the syntax. Ideally I would like to add something like this..

<asp:ImageButton ID="imgPaypalIcon" runat="server" ImageUrl="" OnClick="imgBtnPaypal_Click" />


Here's that nasty line of code...

Dim liByLiteral As New LiteralControl("<a href='https://example.com/catalog/images/" & filenameAndPrice(0) & "' class=""nyroModal imageThumbnail"" style=""padding:3px;"" rel=""gal" & DataBinder.Eval(e.Item.DataItem, "accountID").ToString & """ title=""" & filenameAndPrice(2) & " - PRICE: £" & filenameAndPrice(4) & """ onclick=""openImage('" & filenameAndPrice(1) & "', '" & txtItem.ClientID & "', '" & filenameAndPrice(0) & "');""><img class='lazy" & opacity & "' data-src='https://example.com/catalog/images/thumbnails/" & filenameAndPrice(0) & "' src='./files/images/loader.png' /><p><span>£" & filenameAndPrice(4) & "</span></p></a>")


What I have tried:

I have tried adding the image button in various places but keep getting an error.. Usually error states it is expecting a ')'
Posted
Updated 30-Apr-20 4:30am

1 solution

You can't! MSD documentation states that:
LiteralControl

Represents HTML elements, text, and any other strings in an ASP.NET page that do not require processing on the server.
VB
VB
Public Class LiteralControl
Inherits Control
Implements ITextControl



ITextControl interface "Defines the interface a control implements to get or set its text content."
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900