Click here to Skip to main content
15,909,445 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionBrowser compatibility Error Pin
nandhububbly13-Aug-07 19:50
nandhububbly13-Aug-07 19:50 
AnswerRe: Browser compatibility Error Pin
Michael Sync13-Aug-07 20:16
Michael Sync13-Aug-07 20:16 
GeneralRe: Browser compatibility Error Pin
nandhububbly13-Aug-07 21:34
nandhububbly13-Aug-07 21:34 
GeneralRe: Browser compatibility Error Pin
nandhububbly13-Aug-07 22:33
nandhububbly13-Aug-07 22:33 
GeneralRe: Browser compatibility Error Pin
nandhububbly13-Aug-07 22:40
nandhububbly13-Aug-07 22:40 
QuestionIterating through the Data Reader Results Pin
ASPnoob13-Aug-07 19:31
ASPnoob13-Aug-07 19:31 
AnswerRe: Iterating through the Data Reader Results Pin
Michael Sync13-Aug-07 19:52
Michael Sync13-Aug-07 19:52 
QuestionTable on Asp.net Pin
AnhTin13-Aug-07 18:51
AnhTin13-Aug-07 18:51 
hi all
i want show product same page amazon Big Grin | :-D so i dont know have control in .net 2.0, can do it ???
i am trying build to desgin table with codebehind
but have problem: it only show cell Price on function CreateTable
could u show to me ?????

on the page desgin i have control:
<asp:table id="tabaddform" runat="server" cellpadding="0" cellspacing="0">


and in codebehind into function Page_Load is function viewdata
TableCell tblCell;
TableRow tblRow;
Table tbltable;
Image imgView;
Label lblLable;
private void ViewData()
{
try
{
DataTable dt = LoadData();
string strName, strPrice, strImg;
//y Counter int y = 0;
for (int i = 0; i < dt.Rows.Count; i++)
{
strName = dt.Rows[i]["ProductName"].ToString();
strPrice = dt.Rows[i]["UnitPrice"].ToString();
strImg = dt.Rows[i]["linkimg"].ToString();

if (y == 0)
{
tblRow = new TableRow();
}
tblCell = new TableCell();
//createTable
tblCell.Controls.Add(createTable(strName, strPrice, strImg));
tblRow.Cells.Add(tblCell);
tabaddform.Rows.Add(tblRow);
y++;
if (y == 3)
{
y = 0;
}
}
}
catch (Exception ex)
{
throw ex;

}
}

And function

private Table createTable(string strName, string strPrice, string strImg)
{
try
{
tbltable = new Table();

//Add image
tblRow = new TableRow();
tblCell = new TableCell();

imgView = new Image();
imgView.ImageUrl = strImg;
imgView.ID = "img" + strName;

tblCell.Controls.Add(imgView);
tblRow.Cells.Add(tblCell);
tbltable.Rows.Add(tblRow);

//add Name

tblRow = new TableRow();
tblCell = new TableCell();

lblLable = new Label();
lblLable.ID = "lblName" + strName;
lblLable.Text = "Name: " + strName;

tblCell.Controls.Add(lblLable);
tblRow.Cells.Add(tblCell);
tbltable.Rows.Add(tblRow);

//add Price

tblRow = new TableRow();
tblCell = new TableCell();

lblLable = new Label();
lblLable.ID = "lblPrice" + strName;
lblLable.Text = "Price: " + strPrice +"$";

tblCell.Controls.Add(lblLable);
tblRow.Cells.Add(tblCell);
tbltable.Rows.Add(tblRow);

return tbltable;

}
catch (Exception ex)
{
throw ex;
}
}
AnswerRe: Table on Asp.net Pin
N a r e s h P a t e l13-Aug-07 19:05
N a r e s h P a t e l13-Aug-07 19:05 
GeneralRe: Table on Asp.net Pin
AnhTin13-Aug-07 21:30
AnhTin13-Aug-07 21:30 
QuestionDropDownLists and __EventArugment __EventTarget Pin
shivamray13-Aug-07 18:47
shivamray13-Aug-07 18:47 
AnswerRe: DropDownLists and __EventArugment __EventTarget Pin
John-ph13-Aug-07 20:22
John-ph13-Aug-07 20:22 
Questionchekbox in javascript Pin
Nidhiii13-Aug-07 18:06
Nidhiii13-Aug-07 18:06 
AnswerRe: chekbox in javascript Pin
N a r e s h P a t e l13-Aug-07 18:53
N a r e s h P a t e l13-Aug-07 18:53 
QuestionUpload, download and display images from web server Pin
J Liang13-Aug-07 17:54
J Liang13-Aug-07 17:54 
AnswerRe: Upload, download and display images from web server Pin
N a r e s h P a t e l13-Aug-07 19:18
N a r e s h P a t e l13-Aug-07 19:18 
GeneralRe: Upload, download and display images from web server Pin
J Liang14-Aug-07 14:57
J Liang14-Aug-07 14:57 
QuestionDynamic number of controls Pin
sandrider13-Aug-07 17:54
sandrider13-Aug-07 17:54 
AnswerRe: Dynamic number of controls Pin
shivamray13-Aug-07 18:44
shivamray13-Aug-07 18:44 
GeneralRe: Dynamic number of controls Pin
sandrider13-Aug-07 19:20
sandrider13-Aug-07 19:20 
Questionproblem with SubmitSqlDataSource.InsertParameters Pin
hurrem13-Aug-07 17:50
hurrem13-Aug-07 17:50 
Questionplease help Pin
seemamltn13-Aug-07 17:44
seemamltn13-Aug-07 17:44 
AnswerRe: please help Pin
Michael Sync13-Aug-07 20:03
Michael Sync13-Aug-07 20:03 
AnswerRe: please help Pin
neerubee13-Aug-07 20:46
neerubee13-Aug-07 20:46 
AnswerBAD USER! Pin
leckey14-Aug-07 4:59
leckey14-Aug-07 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.