Code Behind

netpicker9
11-10-2006, 09:16 AM
Hi,

I am displaying values in ASPX Page like this.. (just giving one line of code)
Response.Write("<td align=""right"">" & FormatCurrency(hldAnn, 2) & "</td>")

My constraint is I am getting values from DLL as an Array and doing some manuplations in ASPX Page,
before displaying to the Webpage. I can't use any Grid or some controls, because I am doing lot of manuplations on Array.

How can I place this kind of code in Code behind page? In .aspx.vb page!

Is method which I am using is suggested?

Give me feedback with best suggestion. (if possible with an example)

Thanks

wayneph
11-10-2006, 12:22 PM
What I would do is add an <asp:Literal> control to your page. Then on the client site you can use a StringBuilder to build the HTML. (It is faster than concatenating strings using an ampersand.) Then when you're done you can set the value of the Literal control to the HTML you provide.

Dim sb As New System.Text.StringBuilder()

sb.Append("<td>" & value & "</td>")

Literal1.Text = sb.ToString()

To go true .NET, you could create an <asp:table> object and work with TableRow and TableCell objects, but that's normally more work. (and it takes a little while to get used to.)

In no circumstance is Response.Write the suggested method. You should be able to write your .NET apps without it.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum