Thursday, October 27, 2016

Document dot ready function not working in UpdatePanel

 Document dot ready function not working in UpdatePanel

 $(document).ready(function () {

});
instead of  $(document).ready use below..


var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm != null) {
        prm.add_endRequest(function (sender, e) {
            if (sender._postBackSettings.panelsToUpdate != null) {               
                document.getElementById("SearchBox").style.display = 'none';

                openFileInGrid();
            }
        });

    };

Wednesday, October 19, 2016

Wednesday, October 5, 2016

People Editor control is not working properly inside the Update Panel / inside the GridView



Solution: Insert the Script  
<script type="text/javascript" src="/_layouts/15/entityeditor.js"></script
Under the Update panel control.. as shown below

<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline" runat="server">
  <ContentTemplate>
      <script type="text/javascript" src="/_layouts/15/entityeditor.js"></script>

        <%--Page Or Layoutview Right Side Quick launch--%>
        <div id="divRightView" class="w3-col l9 w3-padding-ver-16" style="width: 80%">
       <asp:GridView ID="gvFilesView" runat="server" ShowHeaderWhenEmpty="True….
       .....
       .....

 <SharePoint:PeopleEditor ID="ppeSelectForViewer" runat="server" MaximumHeight="200" Width="95%" Style="padding: 1px;" BorderColor="#e8e8e8" BorderWidth="1px" BorderStyle="Solid" MaximumEntities="3" ToolTip="Type/Select User name and click on Add User." MultiSelect="true" ValidatorEnabled="true"  Height="90%"> </SharePoint:PeopleEditor>

.....
....
</div>

Call Java script function from c# code behind in SharePoint application page, SharePoint page, user Control and ASP:Updatepanel (Web part)


Call Java script methods from c# code behind in SharePoint application page, SharePoint page, user Control and ASP:Updatepanel (Web part)


SharePoint Page:
  ClientScript.RegisterStartupScript(this.GetType(), "js", "getNodesName();", true);


 Page.ClientScript.RegisterStartupScript(this.GetType(), "js", "<script type= 'text/javascript'> getNodesName();</script>", false);




 ASP:Updatepanel:
ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "MyAction", "CallCodeBhndMethod();", true);