Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am making a popup using jquery but its not working.My coding is this.....


XML
<%@ Page Title="Immigration VisaWalk" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Feedback.aspx.cs" Inherits="VisaWalk.Presentation.Feedback" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HomeHeader" runat="server">
   <script src="../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
     <link href="../Scripts/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.ui.dialog.js" type="text/javascript"></script>
     <link href="../Scripts/jquery.ui.dialog.css" rel="stylesheet" type="text/css" />
     <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
     <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
     <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
     <script src="../Scripts/jquery-1.9.0.js" type="text/javascript"></script>
     <script src="../Scripts/jQuery%20UI%201.10.0.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $(function () {

                $diag = $("#dialog");
                var dialogOpts = {
                    width: 100,
                    height: 100,
                    autoOpen: false,
                    modal: true
                };
                $diag.dialog(dialogOpts);

                $("#Button1").click(function () {
                    $diag.dialog('open');
                    return false;
                });

//                $("#Button1").click(function () {
//                    $diag.dialog('close');
//                    return false;
//                });


            });
        });

    </script>


    <div class="wrapper">
<div id="featured_slide" class="clear">
    <div class="overlay_left"></div>
    <div id="featured_content">
      <div class="featured_box" id="fc1">
        <div id="slideshow">
        <div><img src="../images/Header/VisaWalk.jpg" class="first" /></div>
        <div><img src="../images/Header/VisaWalk1.jpg" /></div>
        <div><img src="../images/Header/immigration.jpg"  /></div>
        <div><img src="../images/Locations/VisaWalk2.jpg"/></div>
        </div>
      </div>
      </div>
 <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
              <asp:SiteMapPath ID="SiteMap1" runat="server">
      </asp:SiteMapPath>

    <div style="float:right" >

   <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" style="float:right"></asp:TextBox>
     <asp:Button ID="Button1" runat="server" Text="Post" onclick="Button1_Click1" style="float:right"/>
     <Free:Assessment id="Assessment1" runat="server" Title="Free Assessment" style="float:right"></Free:Assessment>
 <div id="dialog" title="mkl">
     <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
 </div>
   </div>
  </div>

  </div>

</div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="welcome">
          <h2 class="main_head">&nbsp;&nbsp; Feedback</h2>
          <asp:Literal ID="ltfeedback" runat="server"></asp:Literal>
         <%-- <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Post" onclick="Button1_Click1"/>--%>
        </div>
   <!-- <div  class="assessment">
            <Free:Assessment id="FreeAssessment1" runat="server" Title="Free Assessment"></Free:Assessment>
        </div>-->

</asp:Content>
Posted
Comments
Devang Vaja 5-Mar-13 4:30am    
Priya what is the error coming?
Raje_ 5-Mar-13 4:32am    
Why don't you use fancybox pop up of jquery?
1989priya 5-Mar-13 4:33am    
There is no error showing because of the jquery.I am unable to find out the error manually.So Pleae help.
Devang Vaja 5-Mar-13 4:40am    
hey run in IE and from tools>Internet Options>Advanced>Desable script debuging to off
and you can trace jquery also...

1 solution

Create pop up step by step using jquery

1- Create Style like below for the pop up
CSS
.popup_box {
    display: none;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.59);
    top: 0%;
    z-index: 100;
    position: fixed;
    z-index: 1000000;
}

.popup_details
{
   border-radius: 5px;
    display: none;
    position: absolute;
    _position: absolute;
 min-height: 163px;
    width: 504px;
    background: rgb(248, 243, 243);
    top: 26%;
    left: 33%;
    margin: -50px 0 0 -100px;
    z-index: 100;
    font-size: 15px;
    -moz-box-shadow: 0 0 5px #B9B9B9;
    -webkit-box-shadow: 0 0 5px #B9B9B9;
    box-shadow: 0 0 5px #B9B9B9;

}



.popup_closebtn {
    margin-top: 6px;
    margin-bottom: 6px;
    cursor: pointer;
}
.popup_inner_detail {
    width: 95%;
    margin: 0 auto;
    height: 100px;
    background-color: #f2f2f2;
    border-radius: 3px;
    border: 1px solid rgba(128, 128, 128, 0.24);
    margin-top: 12px;
}


Step 2- Create a mark up like below and place your controls inside that pop up
HTML
<div class="popup_box" id="myPopUp" style="display: none;">
        <div class="popup_details" id="myPopUpDetail" style="display: block; width: 646px;">
</div>
</div>



Step3 -Call the pop using jquery

Show pop up
$('#myPopUp').fadeIn("slow");
$('#myPopUpDetail').fadeIn("slow");

Hide pop up

$('#myPopUp').fadeout("slow");
$('#myPopUpDetail').fadeout("slow");

Hope this helps
 
Share this answer
 
Comments
1989priya 5-Mar-13 4:54am    
In my coding,when in my div keep up above button,when in this div,I call class and id,my button and textbox is invisible.
Jameel VM 5-Mar-13 4:58am    
Put your button after the div.
Jameel VM 5-Mar-13 5:06am    
did you implement that pop up i have shared?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900