LoadTemplate is very slow

J

Justin Dutoit

Hey. Creating a Datagrid programmatically works fine, but there seems to be
a huge performance hit when you use LoadTemplate-

Dim MyTemplate As ITemplate = Page.LoadTemplate("TemplateColumnBuy.ascx")
Dim ColumnBuy As TemplateColumn = New TemplateColumn
ColumnBuy.HeaderText = " Buy "
ColumnBuy.ItemTemplate = MyTemplate
NextGrid.Columns.Add(ColumnBuy)

with an ascx file like so-

<%@ Control Language="VB" %>
<A href="javascript:void(0)" onclick="parent.left.buyItem('<%#
CType(Container, DataGridItem).DataItem("productnumber") %>', '<%#
CType(Container, DataGridItem).DataItem("brand") %>', '<%# CType(Container,
DataGridItem).DataItem("productname") %>', '<%# CType(Container,
DataGridItem).DataItem("price") %>');"><img src='add2.jpg' border=0
onmouseover=this.src='add2mouseover.jpg' onmouseout=this.src='add2.jpg'
title='Click to buy one of this item'></A>

If anyone can suggest a way to improve this, I'd appreciate it. I got the
technique from
http://www.dotnetbips.com/displayarticle.aspx?id=84

Cheers
Justin Dutoit
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top