How to display a defualt profile image in gridview if user didn’t provided any image.
if (fileUpload.PostedFile == null)
{
lblStatus.Text = "No file specified.";
return;
}
else
{
{
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One approach might be to check each row during RowDataBound event to see image exists or not. If it is empty, you can assign a default image url.
Do not forget to add RowDataBound event to your GridView definition.
Or If you do not want to use RowDataBound event. At Page_Load you can manually go through each Row of GridView and check ImageUrl one by one.