Click here to Skip to main content
15,903,724 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: plz help me........ Pin
Paul Conrad29-Jun-08 20:06
professionalPaul Conrad29-Jun-08 20:06 
AnswerRe: plz help me........ Pin
Krazy Programmer10-Apr-08 6:26
Krazy Programmer10-Apr-08 6:26 
GeneralRe: plz help me........ Pin
Christian Graus10-Apr-08 12:48
protectorChristian Graus10-Apr-08 12:48 
GeneralRe: plz help me........ Pin
eyeseetee10-Apr-08 21:31
eyeseetee10-Apr-08 21:31 
GeneralRe: plz help me........ Pin
Christian Graus10-Apr-08 21:44
protectorChristian Graus10-Apr-08 21:44 
GeneralRe: plz help me........ Pin
Krirk10-Apr-08 1:54
Krirk10-Apr-08 1:54 
GeneralRe: plz help me........ Pin
Paul Conrad29-Jun-08 20:04
professionalPaul Conrad29-Jun-08 20:04 
GeneralImages Binding to datalist- Getting Problem Pin
sjs4u10-Apr-08 1:15
sjs4u10-Apr-08 1:15 
Hi,


On Page load I am displaying Products with their images by using the Datalist.

I am binding image_url(Comes from db) to ImageButton.

It's Working Fine.

But When I add the code then It will display only first image. also gives error that

[System.InvalidCastException] = {"Unable to cast object of type 'System.Data.Common.DbDataRecord' to type 'System.Data.DataRowView'."}


protected void dgBindImage_ItemDataBound1(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowView)e.Item.DataItem;
ImageButton lnk = (ImageButton)e.Item.FindControl("imgPic");
//lnk.Text = drv["category_name"].ToString();
lnk.CommandArgument = drv["product_id"].ToString();
}

}


I am using below code for getting the Id of that image. because I am displaying information of image seperately.

protected void imgPic_Command(object sender, CommandEventArgs e)
{
string str = e.CommandArgument.ToString();
Response.Redirect("View_Product.aspx?Product_id=" + str);
}





Thanks
GeneralRe: Images Binding to datalist- Getting Problem Pin
Christian Graus10-Apr-08 1:50
protectorChristian Graus10-Apr-08 1:50 
GeneralGridView Pin
senthilsstil10-Apr-08 1:07
senthilsstil10-Apr-08 1:07 
GeneralRe: GridView Pin
eyeseetee10-Apr-08 1:26
eyeseetee10-Apr-08 1:26 
GeneralAdding textbox to gridview at runtime Pin
IamAmit10-Apr-08 0:54
IamAmit10-Apr-08 0:54 
GeneralRe: Adding textbox to gridview at runtime Pin
kontax10-Apr-08 12:10
kontax10-Apr-08 12:10 
QuestionTabs control - Ajax Control Toolkit Pin
kontax10-Apr-08 0:44
kontax10-Apr-08 0:44 
GeneralRe: Tabs control - Ajax Control Toolkit Pin
eyeseetee10-Apr-08 1:23
eyeseetee10-Apr-08 1:23 
GeneralRe: Tabs control - Ajax Control Toolkit Pin
kontax10-Apr-08 5:05
kontax10-Apr-08 5:05 
GeneralRe: Tabs control - Ajax Control Toolkit Pin
Jesse Squire10-Apr-08 2:30
Jesse Squire10-Apr-08 2:30 
GeneralRe: Tabs control - Ajax Control Toolkit Pin
kontax10-Apr-08 5:04
kontax10-Apr-08 5:04 
GeneralRe: Tabs control - Ajax Control Toolkit Pin
Jesse Squire10-Apr-08 5:20
Jesse Squire10-Apr-08 5:20 
GeneralRe: Tabs control - Ajax Control Toolkit Pin
kontax10-Apr-08 12:13
kontax10-Apr-08 12:13 
QuestionGridView Pin
Vijayitsb9-Apr-08 23:46
Vijayitsb9-Apr-08 23:46 
GeneralRe: GridView Pin
Amit Agarrwal10-Apr-08 0:23
Amit Agarrwal10-Apr-08 0:23 
GeneralRe: GridView Pin
Soumini Ramakrishnan10-Apr-08 0:51
Soumini Ramakrishnan10-Apr-08 0:51 
GeneralRe: GridView Pin
Vijayitsb10-Apr-08 1:23
Vijayitsb10-Apr-08 1:23 
GeneralQuestion Pin
nithydurai9-Apr-08 23:41
nithydurai9-Apr-08 23:41 

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.