views:

34

answers:

3

hi there.

I'm kinda new to ASP.NET and I have much more experience with windows forms. I need to show a table with some result data in a page Now, with winforms I would do something like this

ResultForm myForm = new ResultForm();

myForm.ResultDataTable = dataTable;

myForm.Show();

Any tip on how could I do something similar with Asp.Net?

tks

A: 

You can redirect to a page using Server.Transfer method and in that page use a databound control. You can databind any data controls in ASP.Net, like gridview, datalist etc.

Set the datasource and then databind the control.

rahul
tks, this pointed me into the riht direction. tks
DJPB
A: 

Try using the DataGrid ASP.NET control:

In the .ASPX file

<asp:DataGrid runat="server" id="dgData" AutoGenerateColumns="true" />

In the .ASPX.CS file

dgData.DataSource = dataTable;
dgDate.DataBind();
roosteronacid
A: 

The code that you did work well for "windows-forms", but does not work in ASP.NET. My suggestion, as well as other users too, is that you study a little about web development.

There are huge differences between "web-forms" and "windows-forms", starting with the types of objects and their behavior in the UI.

This code can not be applied to "web-forms" directly.

George