Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a div that contain two child div my problem is the child div is not showing

here is my aspx page code
JavaScript
 <script type="text/javascript">
function loadScript()
{
    $("#Info_dialog").dialog("destroy");

            $("#Info_dialog").dialog({
                resizable: false,
                draggable: false,
                width: 300,
                modal: true,
                autoOpen: false,
                buttons: {
                    OK: function () {
                        $(this).dialog("close");
                    }
                },
                zindex: 2000,
                title: 'Message'
            });
            
            if ($("#Info_dialog").children().length > 0) 
            {
                  $("#Info_dialog").dialog("open");
            }
}

var Manager = Sys.WebForms.PageRequestManager.getInstance();
Manager.add_endRequest(function () {
loadScript();
});
  $(function () {
            loadScript();                     
        });
    </script>


....................
 <asp:UpdatePanel ID="up_FileContainer" runat="server">
 <ContentTemplate>
 div id="Info_dialog" style="display: none;" runat="server" clientidmode="Static">
 <div class="infobar_green"  runat="server" id="div_info" visible="false">
  <asp:Literal ID="Lt_info" runat="server" Text="Record saved successfully!" />
  </div>
<div class="infobar_red"  runat="server" id="div_error" visible="false">
   <asp:Literal ID="Lt_error" runat="server" Text="" />
</div>
</div>
<div id="FileContainerDiv"  runat="server" class="fileblockcontainer">
<div class="file_block">
</div>
</ContentTemplate>
</asp:UpdatePanel>

and here is my .cs code
C#
 if (IsPostBack)
 {
   string ErrorString;
  if (!SomeFunc(out ErrorString))
   {
                   div_info.Visible = false;
                   Lt_error.Text = ErrorString;
                   div_error.Visible = true;
    }
    else
    {
                   div_info.Visible  = true;
                   div_error.Visible = false;

    }

}

here child div is not showing or not showing even i inspect element in chrome
Posted
Updated 15-Jun-12 5:24am
v3
Comments
Timberbird 15-Jun-12 6:55am    
This code can show only div_error control. Do you mean that in case of error you don't see corresponding error message in div_error?
agha_ali22 15-Jun-12 6:56am    
yes

1 solution

Have you added ScriptManager control ?

Partial-Page Update Sample Ajax Application[^]
 
Share this answer
 
Comments
agha_ali22 15-Jun-12 6:58am    
i have asp:ToolkitScriptManager

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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