Diplaying an image in new page from grid.

Posted by Gokul under Regular Expressions on 12/6/2010 | Points: 10 | Views : 982 | Status : [Member] | Replies : 3
Dear friends
I ve loaded an image to grid from Db. I ve a another page with Image tool in it. If the user clicks the image in the grid , the image should be displayed in the new page where i kept the image tool.Can any one help in resolving this issue?



Regards
Gokul.N

Thanks and Regards,
GokulNath Nithy.



Responses

Posted by: Madhuk on: 12/6/2010 [Member] Starter | Points: 25

Up
0
Down
If it is a GridView and you are using Image button to display the image in gridview.
Use Row command event, redirect to next page with the id of the Image row. In the second page based on the id hit the db and display the image as you did in gridview.

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gokul on: 12/6/2010 [Member] Starter | Points: 25

Up
0
Down
I am not clear with your suggestion. Can u give me the clear solution for it.

Thanks and Regards,
GokulNath Nithy.

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhuk on: 12/6/2010 [Member] Starter | Points: 25

Up
0
Down
Can you confirm in which field did you display the image.
<asp:TemplateField>

<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CommandName="image" CommandArgument='<%# Eval("ID")%>' />
</ItemTemplate>
</asp:TemplateField>

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)

{
ImageButton lnk = (LinkButton)FindControl("ImageButton1");
if (e.CommandName == "image")
{

Response.Redirect("page2.aspx?id=" + e.CommandArgument);
}
}

//Page2.aspx Pageload event
int id=Request.QueryString["ID"](int);
Based on the id get the image from the db.


Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response