* Richard Brown wrote:
Why not take a look at the server side gridview control. You can bind
this directly to an xml file.
I have but sadly it's not flexible enough for what I require.
Re code behind 'v' embeded in the aspx, I think it's down to your
preference personaly I think it's a much nicer separation of logic 'v'
design for this to be in a separate .cs file.
Sure I'd like my code in the .cs file where it is seperate from the HTML
At the moment I have (in my HTML):
// some HTML is snipped for brevity
<table border="1">
<%
// some C# code here snipped for brevity
// reader is an XmlReader and is valid..
Response.Write("<tr>");
Response.Write("<td>");
reader.MoveToContent();
string x = reader.Read();
Response.Write(reader.Read());
Response.Write("</td>");
Response.Write("</tr>");
%>
</table>
// more HTML down here...
OK so how could I instead generate this table from the .aspx.cs file
since the thing I cant get my head around is how to be able to insert
the HTML for the table within the correct place in the Response stream.
A call to a public method?
Perhaps I can have in the .aspx file:
<table border="1">
<% // some call to my .aspx.cs file that performs a series of
//Repsonse.Writes
Some_Public_Method_That_Constructs_The_Table();
<table>
But so far I've not worked out how to call code within the aspx.cs file
from within the HTML of the .aspx file.
Am I barking up the wrong tree?