Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > RadBinaryImage with asp:HyperLink

Not answered RadBinaryImage with asp:HyperLink

Feed from this thread
  • mihir avatar

    Posted on Apr 15, 2011 (permalink)

    i put rad binary image in asp:hyperlink and disply image from sql server2005 with size 100 X 100 now when i click on image i want to open 500 X 500 size image i give in hyperlink targer="_blank" means display large image on new page 

    as soon as posible please help me for this type of senario 

    tanking You

    Reply

  • Veli Veli admin's avatar

    Posted on Apr 18, 2011 (permalink)

    Hi mihir,

    To be able to use the image URL RadBinaryImage generates for the displayed image, the binary image itself should be rendered on the page. So, you can use a RadBinaryImage for a small image thumbnail, but to be able to show the large image too, you need a second RadBinaryImage instance. The second instance will be provided the same binary data as the first one, but will have its Width and Height set to a larger value to show a larger image. You can then use a HyperLink and set its NavigateUrl to the ImageUrl property of the larger RadBinaryImage after setting the DataValue:

    <asp:HyperLink ID="Link1" runat="server" Target="_blank">
        <telerik:RadBinaryImage ID="smallImage" runat="server"
            Width="100px" Height="100px" ResizeMode="Fit"/>
        <telerik:RadBinaryImage ID="largeImage" runat="server"
            Width="500px" Height="500px" ResizeMode="Fit" style="display:none"/>
    </asp:HyperLink>

    protected void Page_Load(object sender, EventArgs e)
    {       
        byte[] binaryData = (byte[])((DataView)PhotosDS.Select(new DataSourceSelectArguments()))[1][0];
     
        smallImage.DataValue = binaryData;
        largeImage.DataValue = binaryData;
     
        Link1.NavigateUrl = largeImage.ImageUrl;
    }

    In the above example, I use a second larger RadBinaryImage inside the hyperlink. The second image has display:none style, but is still rendered, otherwise, the binary image won't show the image. In the code-behind, after specifying the binary image data to the 2 binary images, I set the NavigateUrl of my link to the ImageUrl of the second (large) binary image. Attaching the test page.

    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > RadBinaryImage with asp:HyperLink