Deep Linking

3 posts, 1 answers
  1. Jack
    Jack avatar
    136 posts
    Member since:
    May 2003

    Posted 22 Feb 2014 Link to this post


    Is it possible to open the LightBox on page load by using a QueryString value - like the Deep linking function in PrettyPhoto for example?



  2. Answer
    Viktor Tachev
    Viktor Tachev avatar
    2194 posts

    Posted 26 Feb 2014 Link to this post

    Hello Jack,

    I am not sure I completely understand the functionality you would like to achieve. Are you trying to open a specific item in RadLightBox on page load based on a query string? Or you would like to have the url in the address bar changed for every photo in the RadLightBox?

    If you would like to have the former functionality you could use an approach similar to the one described in this article. As illustration a button click is used in the article, however you could use different event like pageLoad().

    In case you would like to implement the latter, I am afraid that such functionality is not available for the control. In this case you could use the DescriptionTemplate of a RadLightBoxItem and add a control that holds the path to the currently displayed image.

    If I have misunderstood what you would like to achieve, would you elaborate in greater detail about the scenario that you would like to implement?

    Viktor Tachev
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. Jack
    Jack avatar
    136 posts
    Member since:
    May 2003

    Posted 13 Mar 2014 in reply to Viktor Tachev Link to this post

    Yes thank you Viktor.

    Got it working now. Cheers, Jack

     Private Sub RegisterJSOpenLightBox(ByVal _lbid As String)

            Dim cstype As Type = Me.[GetType]()
            Dim csname As String = "OpenLightBox"
            Dim cs As ClientScriptManager = Page.ClientScript

            If Not cs.IsClientScriptBlockRegistered(cstype, csname) Then
                Dim cstext2 As New StringBuilder()
                cstext2.Append("<script type=""text/javascript"">")
                cstext2.Append((Convert.ToString("OpenLightBox" + _lbid + "();")))
                cs.RegisterClientScriptBlock(cstype, "OpenLightBox", cstext2.ToString())
            End If
        End Sub

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If lbID > 0 Then
            End If
        End Sub

    ReadOnly Property lbID() As Integer
                If Not Request.QueryString("lbid") Is Nothing Then
                    lbID = Request.QueryString("lbid")
                    lbID = 0
                End If
                Return CInt(lbID)
            End Get
        End Property
Back to Top