Convert JSP TagLibrary refernce to work in ASP.NET Page

I am attempting to convert a JSP page into an ASPX and have a Java ForEach loop which references a java library.  How can I modify the code and reference to work in ASP.NET.

The TagLibary is;
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Open in new window

The loop is;
<c:forEach items="${imageList}" var="loop">
<td><img alt="Image" src="App_Data/${loop}" onclick="setImage(this.title)" title="${loop}"></td>
</c:forEach>

Open in new window

the preceding javascript is;
function setImage(title){
	if(document.getElementById("imagepassword").value==null){
	document.getElementById("imagepassword").value=title+',';
	}else{
		var sampltitle = title+',';
		document.getElementById("imagepassword").value =document.getElementById("imagepassword").value+sampltitle;
	}
}

Open in new window

LVL 7
XGISAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
The following generate a entire table
        <asp:GridView ID="Grid1" runat="server" AutoGenerateColumns="False" ShowHeader="false" >
            <Columns>
            <asp:TemplateField HeaderText="Image">
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" ImageUrl='<%# "App_Data/" + Eval("ImageURL")%>' ToolTip='<%# "" + Eval("ImageURL")%>' onclick="setImage(this.title)" />
            </ItemTemplate>
            </asp:TemplateField>
            </Columns>
        </asp:GridView>

Open in new window

Like this :
<table cellspacing="0" rules="all" border="1" id="Grid1" style="border-collapse:collapse;">
		<tbody><tr>
			<td>
                <img id="Grid1_Image1_0" title="image1.jpg" onclientclick="setImage(this.title)" src="App_Data/image1.jpg">
            </td>
		</tr><tr>
			<td>
                <img id="Grid1_Image1_1" title="image2.jpg" onclientclick="setImage(this.title)" src="App_Data/image2.jpg">
            </td>
		</tr><tr>
			<td>
                <img id="Grid1_Image1_2" title="image3.jpg" onclientclick="setImage(this.title)" src="App_Data/image3.jpg">
            </td>
		</tr>
	</tbody></table>

Open in new window

With the following server side code (Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load) :
            Dim imageList As New DataTable()
            imageList.Columns.Add("ImageURL", Type.GetType("System.String"))
            imageList.Rows.Add("image1.jpg")
            imageList.Rows.Add("image2.jpg")
            imageList.Rows.Add("image3.jpg")

            Grid1.DataSource = imageList
            Grid1.DataBind()

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
XGISAuthor Commented:
Thankyou leakim971, I will test it now, as an alternate to the JS. Your code is always A1!
0
XGISAuthor Commented:
The code did not resolve the original issue but still provided a way forward.. thankyou leakim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.