G
Guest
All I want to do is change the border of the first img control in my html to
0. The other images I want to have border=1. I have an event on my datalist
that calls the following code:
**************
public void main_ItemCreated(Object sender, DataListItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Item) {
HtmlImage imgPatron = new HtmlImage();
imgPatron = (HtmlImage)e.Item.FindControl(Request.Form["patron"]);
if(imgPatron!=null) {
image_count();
if(i_count == 1) {
imgPatron.Border = 0; }
}
}
}
************
When the program runs, the program throws the error "object reference not
set to an instance of an object". I'm kind of new to c#, can anyone tell me
what the problem might be?
0. The other images I want to have border=1. I have an event on my datalist
that calls the following code:
**************
public void main_ItemCreated(Object sender, DataListItemEventArgs e) {
if (e.Item.ItemType == ListItemType.Item) {
HtmlImage imgPatron = new HtmlImage();
imgPatron = (HtmlImage)e.Item.FindControl(Request.Form["patron"]);
if(imgPatron!=null) {
image_count();
if(i_count == 1) {
imgPatron.Border = 0; }
}
}
}
************
When the program runs, the program throws the error "object reference not
set to an instance of an object". I'm kind of new to c#, can anyone tell me
what the problem might be?