user1273528
user1273528

Reputation: 1

asp.net automatically open lightbox with the paramaters

I have a page in c# that redirects to another page like

Response.Redirect("default.aspx?name=" + user.Firstname + "&surname=" + user.Lastname).

default.aspx has a lightbox. I want to open this lightbox when I redirect the page that include this lightbox. Also, I want to show the parameters in that lightbox input fields. Is there a way to achieve this?

Thanks for any help.

Upvotes: 0

Views: 1090

Answers (1)

Prasad Jadhav
Prasad Jadhav

Reputation: 5208

I am afraid you cannot do it with Lightbox.
Lightbox plugin works on <a> tag and fetches value form href attribute. Also it specially design for Images as you can see if you provide a URL to page it doesnt load it.
For Intance, if you provide,

<a href="page.html" id="a1" >Click Me</a>

it will keep showing the loading page.
Instead try using thickbox to show the current user parameters.
For thickbox to show a page you can use

<script language="javascript" type="text/javascript" src="javascript/thickbox.js"></script>
<a id="a1" href="#" title="Click me" class="thickbox">Call me</a>           

<script type="text/javascript" >
    $(document).ready(function(){           
        var anchor = document.getElementById("a1");
        var username= '<%= Request.QueryString["username"]%>';
        var url="second.html?height=500&width=700&modal=true&TB_iframe=true&username="+username;
        $('#a1').attr("href", url);
        anchor.click();                         
    });
</script>

Let me know if it worked.

Upvotes: 1

Related Questions