Home » Asp.net

Load page in LightBox

dear all i want a lightbox appear in pageload and display in lightbox an aspx page not an iamge


any suggestion




2 Answers Found


Answer 1

You can definitely do this with html but I'm not sure it will work with asp.net pages.


Answer 2

hi Eman,

you can achieve this by jQuery colorbox, here is an example for your reference:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head2" runat="server">
    <style type="text/css">
            font: 12px/1.2 Verdana, Arial, san-serrif;
            padding: 0 10px;
        a:link, a:visited
            text-decoration: none;
            color: #416CE5;
            border-bottom: 1px solid #416CE5;
            font-size: 13px;
            margin: 15px 0 0 0;
    <link media="screen" rel="stylesheet" href="http://colorpowered.com/colorbox/core/example1/colorbox.css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
    <script src="http://colorpowered.com/colorbox/core//colorbox/jquery.colorbox.js"></script>
        $(document).ready(function () {
            //Examples of how to assign the ColorBox event to elements
            $(".example7").colorbox({ width: "80%", height: "80%", iframe: true });

            //Example of preserving a JavaScript event for inline calls.
            $("#click").click(function () {
                $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
                return false;
    <form runat="server">
    <a class='example7' href="about.aspx">Outside Webpage (Iframe)</a></p>

 the sample is from http://colorpowered.com/colorbox/core/example1/index.html



dear all i want a lightbox appear in pageload and display in lightbox an aspx page not an iamge


any suggestion





I have a number of websites that suffer from slow loading due to third party advertising. The ads exist in as unique UserControls that load in ContentPlaceHolders created just for advertising. The problem occurs if an ad has difficulting contacting the host. The page will get stuck trying to load the advertisement and will either take forever to load or require a refresh. There is nothing wrong with the design of my pages and the problem is solely the fault of the advertising services.

I am wondering if there is a way to assign a load order to the ContentPlaceHolders so that the one containing the main page content loads before the ads. The would preferably be done on the MasterPage and should result in something that I visualize in my mind as:

Set Load Priority

ContentPlaceHolder2 Prority = 1

ContentPlaceHolder1 Priority = 2

ContentPlaceHolder4 Priority  = 3

ContentPlaceHolder2 Priority = 4

I don't know where to begin when looking for how to do this. I started on Goolge with searches for "load priority", "load order", "deferred load", and other searches that yeilded nothing more that information about the page event lifecycle.

Here is an example of a site that has this problem with slow ads: Illegal Alien Report


I am trying to have the page fully load up and then after that load my gridviews as they take some time to generate..

Right now I do it with a timer and an update panel with the timer being set to 1 second which works perfectly fine but..

I don't want the page to be using the update panel when they click any button on it etc., I want it to function as a regular page.  What is the solution to this?

Another question is.. If i want to use this layout for multiple pages, what is the best way to do it so later on if I decide to change something in the layout I wouldn't have to go through all of these pages just to change 1 item.

Hello  ,

I am working in ASP 3  and using Ajax.net ,  I have to  load  aspx pages  by traditional Ajax to DIVs  and  that work good  for  me several time  ,  but in my last time  when I  load an aspx page which  have a CascadingDropDown  to deploy 2 cascading dropdownlist to a DIV by traditional Ajax(XMLHttpRequest)  , i have empty dropdownlist which  means the CascadingDropDown  does not work and does not retrieve data from web service page  .

I note that any client script does not work in this case even if i use ClientScript.RegisterStartupScript or  ClientScript.RegisterClientScriptBlock ,  I don't  know what i can do ,  maybe i should use an iframe ,

but are there any other suggestion :D ,

and  thank  you all


can anybody plz tell me how to stop re-loading of page after selecting a date from a  calendar control in a aspx page.

I want to show the selected date in a Textbox control but i don't want to re-load the page.






I have a web page which has about 11 gridviews.Hence the page takes bout 15 seconds to load.The grids are 1 below the other.They are populated at the page load.

I need a solution to reduce page load time. Is there a way,where the gridview loads only if user scrolls to it. I donot want the user to make selection for everytime he wishes to see a gridview. The page should show gridview if its data is bound to it, not waiting for entire page gridviews to get populated.


Hi everybody.

My Page_Load events are being called when I leave the page, so If im on Page1.aspx and I click to a link for Page2.aspx, the Page_load for Page1 is being fired. On a few of my pages I have some complex tasks being done in the Page_Load, which I dont need to be done when leaving the page.

Is there a way that I can capture the fact that I'm leaving the page? I would have thought that getting the request object at this point would show tht I had requested Page2 but it doesnt. It shows Page1.aspx.

Thanks for your help!



Hi friends, now a days i'm working on my project. In project there is a aspx page which is binded with a masterpage, the problem is that when i run the project in debugging mode i found that page load event of a page is firing two times instead of one along with masterpage page's page load event. This is crreating a problem in filling a grid. I searched through the internet for this problem some says that it may happen if u have any image whose src="" or due to some bad HTML's on page .But i've gone through the page it does not contain any image whose src="" .What is the problem please help...


I am new to Visual Studio Load Test. I have a web test that browse test.aspx?type=A and test.aspx?type=B and I have set up a load test. After completed, it showed the two urls as one page i.e. test.aspx (response time = 1.5 sec).

Is there any way I can make load test tool to differentiate the page by query string?

e.g. I would like to see the following

test.aspx?type=A (response time: 1.3 sec)

test.aspx?type=B (response time: 1.7 sec)



I have a page to which i send some variables with the GET method.

In my VB back-end i get those variables using Page.Request.QueryString("<name>")

If i then use the IsNumeric method to make shure it is an numeric string i get True back as value.

When i then try to transform the string to an Integer using val, cìnt, Integer.Parse or cType I get an error saying that my string could not be converted to a integer.

So i made an error page which gives me all the info i need to deal with the problem (view below)

Exception Message: Conversion from string "" to type 'Integer' is not valid.
String to convert: 57714
IsNumeric: True
Stacktrace: at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value) at Evaluated.LoadContainer.Load(Page Page, HtmlDocument htmlDoc) in C:\WINDOWS\TEMP\b_rfimc-.0.vb:line 211


I don't understand.

IsNumeric confirms that it is a numeric string and that it should be convertable to an Integer. So why won't it work.

I don't think that my code should provide any extra information because it only gets the querystrings, uses IsNumeric and then tries to convert them.




Is it possible to load a .aspx page inside the frame control of a silverlight page?

Thanks in Advance!!!!

Best regards,
Subalakshmi Vijayarajan.


In order to improve the load experience of my Silverlight App, I dynamically load dlls when my application boots up. The Pages are defined in a dynamically loaded application. The default PageResourceContentLoader tries to load pages by (ultimately) calling Application.GetResourceStream(targetUri);

As far as I'm aware Application.GetResourceStream only searches for items in the original application's xap file and there is no way of altering this behavior.

Am I correct about this?

The solution I have adopted is to create a custom INavigationContentLoader. The problem I'm then seeing is that the Pages don't seem to be destroyed by the GC after you navigate away from them. There's always an instance "left over" in memory as a result of the Page's visual tree referencing the page as a Parent (see image here).

If I'm using an INavigationContentLoader how am I meant to dispose of a page instance when I navigate away from it? 

I have installed Shadowbox Lightbox on a Drupal installation and I can't get it to open in IE. It opens in all the versions of other browsers.

Hi all my friends

 I am using a traditional alert with client.registerstartupscript in asp.net.

I wish to beautify my page to use a  light box when the user clicks a button.

In other words i wish to display a message box asks user for regstration if he is unregistered this using light box

any recommendation please


Hi experts,

I am using css style sheet for the lightbox effect means not using any .js files. Everything is working fine, but the problem is lightbox is working in Firefox but not in IE.

My code is


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">    
        <title>LIGHTBOX EXAMPLE</title>
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            -moz-opacity: 0.8;
            filter: alpha(opacity=80);
        .white_content {
            display: none;
            position: absolute;
            top: 25%;
            left: 25%;
            width: 50%;
            height: 50%;
            padding: 16px;
            border: 16px solid orange;
            background-color: white;
            overflow: auto;
    <form id="frm1" runat="server">
        <%--<p>This is the main content. To display a lightbox click <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">here</a></p>
        <asp:Table style="display: none;" id="light" runat="server">
                    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>
                    <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a>
        <asp:Table style="display: none;" id="fade" runat="server">
        <asp:Table ID="tbldynamic" runat="server">
            <asp:TableRow runat="server" ID="trtest2"></asp:TableRow>
        <asp:Table style="display: none;" id="Table1" runat="server">
            <asp:TableRow runat="server" ID="trtest">
        <asp:Table style="display: none;" id="Table2" runat="server">



using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        TableRow tr = new TableRow();
        TableCell tblcl_anc = new TableCell();
        HtmlAnchor htmlanchor = new HtmlAnchor();
        //string x = Convert.ToString(Table1);

        //htmlanchor.HRef = string.Format("javascript:{{document.getElementById('{0}').style.display='block';document.getElementById('{1}').style.display='block';}}", trtest, Table2);

        htmlanchor.HRef = ("javascript:void(0)");
        htmlanchor.Attributes.Add("onclick", "document.getElementById('" + Table1.UniqueID + "').style.display='block';document.getElementById('" + Table2.UniqueID + "').style.display='block'");
        htmlanchor.Title = "Welcome"; //tooltip
        htmlanchor.InnerText = "test";
       // trtest.Cells.Add(tblcl_anc);

        TableRow tr3 = new TableRow();
        TableCell cell_tb = new TableCell();
        TextBox tb_tooltip = new TextBox();
        tb_tooltip.ID = "txtToolTip_tt";
        //tb_tooltip.Style["display"] = "none";
        tb_tooltip.TextMode = TextBoxMode.MultiLine;
        tb_tooltip.CssClass = "form2 m_text";

        HtmlAnchor htmlanchor2 = new HtmlAnchor();
        htmlanchor2.HRef = ("javascript:void(0)");
        htmlanchor2.Attributes.Add("onclick", "document.getElementById('" + Table1.UniqueID + "').style.display='none';document.getElementById('" + Table2.UniqueID + "').style.display='none'");
        htmlanchor2.Title = "close"; //tooltip
        htmlanchor2.InnerText = "close";
         * HtmlAnchor anchor = new HtmlAnchor();
        anchor.HRef = string.Format("javascript:{{document.getElementById('{0}').style.display='none';document.getElementById('{1}').style.display='none';}}", light, fade);
        anchor.Title = "Close";
        anchor.InnerText = "Close";
                 * */

    private void MsgBox(string msg)
        string alertScript = "<script language=JavaScript>";
        alertScript += "alert('" + msg + "');";
        alertScript += "</script" + ">";
        if (!IsClientScriptBlockRegistered("alert"))
            this.RegisterStartupScript("alert", alertScript);

Please help me, I am trying from long time.


Hi all,

I have two sites: "Default.aspx" and "mySubsite.aspx". In "Default.aspx" I have a hyperlink to open a lightbox window, which works perfectly.

Here is the code for it:

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
<a href="mySubsite.aspx" class="lbOn">Open Lightbox Window</a>

When the lightbox window opens("mySubsite.aspx.cs") I placed two drop down lists ( parent child use) . First DDL contains all the parent names and the second DDL returns the subname to the corresponding parent name. So basically I select a parent item and get the right subname for it.

Code for it looks this way.

protected void Page_Load(object sender, EventArgs e)

if (!IsPostBack)
DDLParent.DataSource = data_string;


protected void DDLParent_SelectedIndexChanged(object sender, EventArgs e)
DDLSubname.DataSource = subname_data;


<asp:DropDownList ID="DDLParent" runat="server" onselectedindexchanged="DDLParent_SelectedIndexChanged" Autopostback="true"> </asp:DropDownList>          
<asp:DropDownList ID="DDLCampaign" runat="server"></asp:DropDownList>

So now the problem is that when I select one item from the parent DDL in the lightbox window, the lightbox window close and opens the "mySubsite.aspx" as main window. My guess is that the postback, which is necessary to populate the Subname DDL, closes the "Default.aspx" and opens the "mySubsite.aspx" in full.

Is there a way to update the DDLs in the lightbox?  I tried several ideas, but nothing worked..

Many thanks in advance for any help.


im using  Telerik with multipageview and menu in masterpage . the multi page viewe show its pages in iframe nad in onepage "iframe" i open popup using RadWindow

the pb that i want to make the menu and all controls in master page inactive while the pop up is displayed

which means lightbox display when i click the button in iframe to display the 



any suggestion???

Hi !
I am how to using lightbox in datalist.
Save imagespath in DB and i using lightbox in datalist .
but what ?

hi all,

      i have done one website, i need when Admin create new account registration for new user he should give his password when click submit button..here i need to open lightbox window to give a password if password is correct the behid of lightbox windows data should store the database otherwise it must be validate the password and return to lightbox.. if anybody have related idea and some usefull link please send me..

Thank You,


I am currently creating an application in Silverlight using C# in which an on-click event, I want to open a flash application with Lightbox JQuery implentation. Any suggestions will be helpful. Thanks.

<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure