This is a migrated thread and some comments may be shown as answers.

LightBox cannot work

1 Answer 73 Views
LightBox
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
asked on 02 Mar 2015, 01:02 PM
I follow the help article to learn lightbox,but the picture does not show after running

1、Create a new webpage in Visual Studio.
2、Add a RadLightBox from the Telerik UI toolbar.
3、Add an Image control(named Image1) to the web page.
4、Into the item collection of the RadLightBox add a new item(item 0) and set the TargetControlID(Image1) to the Image ID.
5、Set ImageURL(~/img/1.jpg) to point to the image, which will be displayed into the window.
6、Add a title and description of the item that will provide descriptive information about the image.
7、Press F5 to compile and run the application.

the aspx file
==================================================================================================
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TelerikWebApp1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    <div>
    
    </div>
        <telerik:RadLightBox ID="RadLightBox1" runat="server" PreserveCurrentItemTemplates="False">
            <Items>
                <telerik:RadLightBoxItem ImageUrl="~/img/1.jpg" TargetControlID="Image1">
                </telerik:RadLightBoxItem>
            </Items>
        </telerik:RadLightBox>
        <asp:Image ID="Image1" runat="server" Height="49px" Width="107px" />
    </form>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Mar 2015, 09:54 AM
Hello ,

I tested your code on my end but it is working as expected. Please download the attached example and let me know if it is ok at your side. You only need to add the BIN folder with the assemblies and  then open the folder as a website in Visual Studio.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
LightBox
Asked by
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or