Click here to Skip to main content
16,004,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a GridView .
In that , i have a template field and in the template field i have an image control.
I am binding image url to the image control based on database values and other times it is hidden(visible = false).
But it gives me an error saying image url is required.
In the row databound event of the grid..i am making the image visible as false when i don't want to give it an url but even after this the visibility remains true and error occurs saying imageurl is required.
Posted
Comments
I have already done this type of thing. Can you post the code? Image should hide. There should not be any issue.
aks.shan 16-Jan-14 23:02pm    
Can i get a solution for this?
aks.shan 16-Jan-14 23:03pm    
But its something like this:
theres a hidden field hdnPriority and image control imgPriority.

All m doing is if(hdnPriority ==String.Empty)
{
imgPriority.visible = false;
}
else
imgPriority.ImageUrl = "~/Images/Blue_Background.png";

How can i go ahead.
Thanks.
aks.shan 16-Jan-14 12:08pm    
But its something like this:
theres a hidden field hdnPriority and image control imgPriority.

All m doing is if(hdnPriority ==String.Empty)
{
imgPriority.visible = false;
}
else
imgPriority.ImageUrl = "~/Images/Blue_Background.png";

How can i go ahead.
Thanks.
aks.shan 16-Jan-14 12:10pm    
This gives an error saying ImageUrl is required.
Note:
Image control and hidden field is in item template.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900