Tuesday, 23 December 2014

jQuery Plugins not working after ASP.Net AJAX UpdatePanel Partial PostBack or when Asynchronous request is over

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
    rel="stylesheet" type="text/css" />
<script type="text/javascript">
    //On Page Load
    $(function () {
        $("#dvAccordian").accordion();
        $("#tabs").tabs();
   });
    //On UpdatePanel Refresh
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm != null) {
        prm.add_endRequest(function (sender, e) {
            if (sender._postBackSettings.panelsToUpdate != null) {
                $("#dvAccordian").accordion();
                $("#tabs").tabs();
            }
        });
    };
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div id="dvAccordian" style="width: 400px">
            <h3>
                Section 1</h3>
            <div>
                <p>
                    This is content of Section 1
                </p>
            </div>
            <h3>
                Section 2</h3>
            <div>
                <p>
                    This is content of Section 2
                </p>
            </div>
            <h3>
                Section 3</h3>
            <div>
                <p>
                    This is content of Section 3
                </p>
            </div>
        </div>
        <br />
        <div id="tabs">
            <ul>
                <li><a href="#tabs-1">Tab 1</a></li>
                <li><a href="#tabs-2">Tab 2</a></li>
                <li><a href="#tabs-3">Tab 3</a></li>
            </ul>
            <div id="tabs-1">
                Content 1
            </div>
            <div id="tabs-2">
                Content 2
            </div>
            <div id="tabs-3">
                Content 3
            </div>
        </div>
        <br />
        <asp:Button ID="btnRefresh" runat="server" Text="Refresh" />
    </ContentTemplate>
</asp:UpdatePanel>

Saturday, 20 September 2014

Access Application Page Via URL After Deploy UR Solution On Local Server For Sharepoint Developer

Access Application Page In URL Sharepoint Developement 2013

Click Image To Enlarge
Access Via URL 

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\Solution Name\URApplicationPagename.aspx

Thursday, 18 September 2014

Gridview On Row Delete Image Click to Delete Row

Click Image To enlarge
.Ascx Gridview Code

 <asp:TemplateField HeaderText="Delete">
            <ItemTemplate>
           <asp:ImageButton ID="imgDelete" Width="50" Height="30"  runat="server" ImageUrl="../_layouts/15/images/delete.jpg" OnClick="imgDelete_Click"  OnClientClick="javascript:return confirm('Do you really want to delete the attachment?');" />
            </ItemTemplate>
        </asp:TemplateField>

.CS Code

 protected void imgDelete_Click(object sender, ImageClickEventArgs e)
            {
                try
                {
                    SPSecurity.RunWithElevatedPrivileges(delegate()
                    {
                        using (SPSite Osite = new SPSite(SPContext.Current.Site.Url))
                        {
                            using (SPWeb oweb = Osite.OpenWeb())
                            {
                                ImageButton imgDelete = sender as ImageButton;
                                GridViewRow gvrow = (GridViewRow)imgDelete.Parent.Parent;
                                int rowindex = gvrow.RowIndex;
                                HiddenField lblid = (Employee_Grid.Rows[rowindex].FindControl("hdnItemID") as HiddenField);

                                SPList Attachmentlist = oweb.Lists.TryGetList("Employee_Details");
                                oweb.AllowUnsafeUpdates = true;
                                Attachmentlist.Items.DeleteItemById(Convert.ToInt32(lblid.Value));
                                oweb.AllowUnsafeUpdates = false;
                                //BindAttachments(gvattach, CurrentUser);
                                GetEmployeedata();
                            }
                        }
                    });
                }
                catch (Exception ex) { }


            }    
Add These In page Load

  protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                GetEmployeedata();
            }
           
        }

access Web application (Web.Config) In SharePoint 2013

Here To access a webconfig file of each webapplication in sharepoint for connectionstring

Establishment or any other use

url of access:C:\inetpub\wwwroot\wss\Virtual Directories\29312

here- 29312 my webapplication port number

access ur  webapplication by ur needed port number


Click Image To enlarge