S
Samy
Hi There,
I am trying to display images in a gridview and display only valid
images from the html in the database (and not display spacers, 1x1
pixel images etc). For this, I have a gridview with an asp:Image
control in one of its template. I populate the image by setting the
imageurl (remote url) of the image in the rowdatabound event of the
gridview. I have an aspx page called draw.aspx and i do it this way..
imageurl = draw.aspx?imageurl=url
In the draw.apxz.cs, i have a method which takes the url and using the
webclient, creates a bitmap and saves that to the response like this..
bmp.Save(Response.OutputStream, bmp.RawFormat);
This works fine, but all images are displayed in the gridview. I would
like to check for the height and width of the image and not show the
rows of the gridview based on those attributes. . I am doing it in the
PreRender event, trying to check the height and width of the image in
each row of the gridview. For some reason, if I debug the code, I see
that both height and width of the image are 0. First thing, I am not
sure why both are 0. Secondly, I am wondering what is the best way of
checking this and where(which event) should this be checked?
I really appreciate your suggestions and recommendations.
Thanks a lot!!
I am trying to display images in a gridview and display only valid
images from the html in the database (and not display spacers, 1x1
pixel images etc). For this, I have a gridview with an asp:Image
control in one of its template. I populate the image by setting the
imageurl (remote url) of the image in the rowdatabound event of the
gridview. I have an aspx page called draw.aspx and i do it this way..
imageurl = draw.aspx?imageurl=url
In the draw.apxz.cs, i have a method which takes the url and using the
webclient, creates a bitmap and saves that to the response like this..
bmp.Save(Response.OutputStream, bmp.RawFormat);
This works fine, but all images are displayed in the gridview. I would
like to check for the height and width of the image and not show the
rows of the gridview based on those attributes. . I am doing it in the
PreRender event, trying to check the height and width of the image in
each row of the gridview. For some reason, if I debug the code, I see
that both height and width of the image are 0. First thing, I am not
sure why both are 0. Secondly, I am wondering what is the best way of
checking this and where(which event) should this be checked?
I really appreciate your suggestions and recommendations.
Thanks a lot!!