G
Gsnke
---------------------------------
I'm getting this error:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 67: if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
Line 68: {
Line 69: string sImageID =
(((System.Data.Common.DbDataRecord)e.Item.DataItem)["ImageID"]).ToString();
Line 70: if(sImageID.Length < 1)
Line 71: {
---------------------------------
with this code:
private void rptStoryList_ItemDataBound(object sender,
System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
string sImageID =
(((System.Data.Common.DbDataRecord)e.Item.DataItem)["ImageID"]).ToString();
if(sImageID.Length < 1)
{
((System.Web.UI.WebControls.Image)e.Item.FindControl("imgIT")).Visible
= false;
}
}
}
I'm getting this error:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 67: if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
Line 68: {
Line 69: string sImageID =
(((System.Data.Common.DbDataRecord)e.Item.DataItem)["ImageID"]).ToString();
Line 70: if(sImageID.Length < 1)
Line 71: {
---------------------------------
with this code:
private void rptStoryList_ItemDataBound(object sender,
System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
string sImageID =
(((System.Data.Common.DbDataRecord)e.Item.DataItem)["ImageID"]).ToString();
if(sImageID.Length < 1)
{
((System.Web.UI.WebControls.Image)e.Item.FindControl("imgIT")).Visible
= false;
}
}
}