To make sure i understand the question, let me rephrase it. You are
wondering how to put values from some data structure (say a dataset) into a
web page. I take it the point to your question is that you don't want to
manually have to do:
txtEmail.Text = datatable.rows[0]["Email"];
for some 100 fields?
In asp.net 2.0 there'll be a DetailsView to help automate this otherwise
highly manual process
(
http://msdn.microsoft.com/asp.net/wh...library/en-us/
dnvs05/html/grddetview.asp#grddetview_topic5)
Currently, you can look for a similar controls for 1.0...Your only other
alternative is to do something like:
<table>
<tr>
<td>First Name</td>
<td><asp:textbox runat="server" id="firstName" /></td>
</tr>
<tr>
<td>LastName</td>
<td><asp:textbox runat="server" id="lastName" /></td>
</tr>
</table>
then in codebehind:
foeach (DataColumn column in datatable.Columns){
Control c = page.FindControl(c.ColumnName)
if (c != null){
if (typeof(c) == TextBox){
((TextBox)c).Text = datatable.rows[0][column];
}else if (typeof(c) == RadioButtonList){
....
}
}
}
anyways, just some rough ideas...
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Vlady" <> wrote in message
news:94946B6C-3826-432D-BE45-...
> Hello. I recently built an ASP.NET "financial" application. I got to the
> point where I have a HTML template (a contract) which needs to be filled
with
> various data from the database. I put a "generate contract" button on my
ASPX
> page, but I totally lack ideas of how to put the data in the correct
places
> in the html file. I was recommended (actually "do like this" from my boss)
to
> enclose the variable name like this {variable_name} in the html, and he
said
> that there are some functions to assign the value to the variable but
how???
> So the question is: how can I place the data that I gather from the
database
> inside the html file using only asp.net, without any report generation
tool
> (click the button and there you go: window with the contract filled)? A
> little more elaborated example would be highly appreciated as this is my
> first ASP.NET app.