Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to implement functionality for an image thumbnail within a gridview whereby I can view it full size in a new browser window using the example at :
http://odetocode.com/articles/172.aspx

In the last part of the article there is an instruction to pass an additional parameter in the query string so that you view the full size of the image when it opens in new browser window. How do I implement this functionality? I understand that the additional parameter should refer to source below as outlined in the article.

ASP.NET
        <ItemTemplate >
  <a href='<%# "getImage.aspx?ThumbNail=\"N\"&ID=" + DataBinder.Eval(Container.DataItem, 
                   "ImageIdentity")  %>'>
      <img runat="server" src='<%# "getImage.aspx?ID=" + DataBinder.Eval  
       (Container.DataItem, "ImageIdentity")%>' ID="Img1"/>
  </a>
</ItemTemplate>


I want to know how i can pass the additional parameter to the snippet below in the getImage.aspx page

C#
        System.Data.SqlClient.SqlDataReader Reader=null;
      string ImageIdentity = Request.QueryString["ID"].ToString();
      SqlConnection sqlConnection = new SqlConnection(@"initial catalog=Articles;user

id=sa;password=;server=myServer");
      sqlConnection.Open();     
      SqlCommand sqlCommand = new SqlCommand("Select Images,ImageType from Images where

imageKey="+ImageIdentity  ,sqlConnection);
      Reader= sqlCommand.ExecuteReader(CommandBehavior.CloseConnection); 
      Reader.Read();


What I have tried:

I have tried something of this order:
VB.NET
con = New SqlConnection(ConfigurationManager.ConnectionStrings("Constring").ConnectionString)
        If Not IsPostBack Then
            Dim docID = Request.QueryString("id")
            Dim docIDapp = Request.QueryString("idapp")
            If Request.QueryString("id") <> "" Then
                cmd = New SqlCommand("Select * from ONLINELOANS where id = '" & docID & "'", con)
                'ElseIf Request.QueryString("entity") <> "" Then
                '    cmd = New SqlCommand("Select * from PROCURING_DOCUMENTS where id = '" & docID & "'", con)
                'Else
                '    cmd = New SqlCommand("Select * from CAPITAL_DOCUMENTS where id = '" & docID & "'", con)
            End If
            If Request.QueryString("idapp") <> "" Then
                cmd = New SqlCommand("Select * from ONLINELOANS where id = '" & docID & "'", con)
Posted
Updated 4-Jan-17 8:29am
v2

1 solution

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