about loading page
-
hi all I want to display different data in a table at runtime.This table contain three columns. Id being the first and name being the second column. Third column is used to display a page whose link is loaded from database. All data in the table is loaded on runtime and table is also generated at runtime using C#. My problem is that, when i use the tag to display the page in the third column, then in the first row data is loaded fine. But in subsequent rows only the data in third column i.e pages ( using <iframe) ) are loaded fine but data in other rows is now displayed( i mean id and name). rows are not displayed.only straight lines of columns are displayed for first and second columns. But for third column all rows are displayed fine... but when i use <img> tag then all thing happend displayed in desired order in the table. since i want to display page not the img so <img> tag is not my requirement. Can somebody tell me how to complete this job using either <iframe> or some other tag. </x-turndown>
-
hi all I want to display different data in a table at runtime.This table contain three columns. Id being the first and name being the second column. Third column is used to display a page whose link is loaded from database. All data in the table is loaded on runtime and table is also generated at runtime using C#. My problem is that, when i use the tag to display the page in the third column, then in the first row data is loaded fine. But in subsequent rows only the data in third column i.e pages ( using <iframe) ) are loaded fine but data in other rows is now displayed( i mean id and name). rows are not displayed.only straight lines of columns are displayed for first and second columns. But for third column all rows are displayed fine... but when i use <img> tag then all thing happend displayed in desired order in the table. since i want to display page not the img so <img> tag is not my requirement. Can somebody tell me how to complete this job using either <iframe> or some other tag. </x-turndown>
Hi, I did know your problem because I did it. Now I give you a bunch of codes in Visual Basic .NET because i am familiar with VB .NET. But I think it is very easy to translate into C# :) I assume that you have created a table with online one row is the header with 3 columns: ID, Name, URL. The table name is tbMyTable, you can create this table in design mode, or using tag. Then in the Page_load events, your code is
Dim cnn as sqlConnection = new sqlConnection(connectionString) 'connectionString is the your connection String Dim cmd as sqlCommand = new Command() Dim reader as new sqlDataReader() cnn.open() cmd.Connection = cnn cmd.CommandText = "SELECT * FROM tbContent" reader = cmd.ExecuteReader() Do While reader.read Dim dr as new TableRow() Dim dcID as New TableCell() Dim dcName as New TableCell() Dim dcURL as New TableCell() dcID.Text = reader.getInt32(0) dcName.Text = reader.getString(1) dcURL.text = "<a href = ''>" & reader.getString(2) & "</a>" dr.Cells.Add (dcID) dr.Cells.Add (dcName) dr.Cells.Add (dcURL) tbMyTable.Rows.Add (dr) Loop reader.close cnn.close()
Ich liebe .NET :)