Free Pluralsight 6Moth Subscription

 

Hi ,

 

PLease refer the below link to get free 6 Month Pluralsight subscription.

 

Free 6Month PluralSight subscription

 

Thanks,

Siddi.

Posted in Uncategorized | Leave a comment

Filtering in GridView


Filtering.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Filtering.aspx.cs" Inherits="GridViewDemo.Filtering" %>

<!DOCTYPE html>

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

<form id="form1" runat="server">

<div>
            
            <asp:LinkButton ID="lbRemoveFilterOutstanding" runat="server" Text="Remove Filter" OnClick="lbRemoveFilterOutstanding_Click"></asp:LinkButton>
            <asp:GridView runat="server" ID="FilterGridView" AutoGenerateColumns="False" OnSelectedIndexChanged="FilterGridView_SelectedIndexChanged">
                <Columns>
                    <asp:TemplateField SortExpression="DeptID">
                        <HeaderTemplate>
                            <asp:LinkButton ID="lbItem" runat="server" Text="DeptID" CommandName="Sort" CommandArgument="DeptID"></asp:LinkButton>
                            
                            <asp:TextBox runat="server" ID="txtDeptID" AutoPostBack="true" OnTextChanged="txtItem_TextChanged"></asp:TextBox>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <%#Eval("DeptID") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>


            </asp:GridView>
        </div>

    </form>

</body>
</html>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;</code>

namespace GridViewDemo
{
public partial class Filtering : System.Web.UI.Page
{
class Department
{
public int DeptID { get; set; }
public List Employees { get; set; }
public string DeptName { get; set; }
}
class Employee
{
public int EmpID { get; set; }
public string Name { get; set; }
}
List LoadDepartmentData()
{
return new List() {new Department() { DeptID = 1, DeptName="CSE",Employees = new List()
{ new Employee() { EmpID = 10, Name = "Siri" },
new Employee() { EmpID=11,Name="Siddi"}
} },new Department() {DeptID = 2,DeptName="ECE", Employees = new List()
{ new Employee() { EmpID = 10, Name = "Siri" },
new Employee() { EmpID=11,Name="Siddi"}
} } };
}

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
FilterGridView.DataSource = LoadDepartmentData();
FilterGridView.DataBind();
}
}

protected void txtItem_TextChanged(object sender, EventArgs e)
{
TextBox txtBox = (TextBox)sender;
List lstDept = LoadDepartmentData();
if (sender is TextBox)
{
if (txtBox.ID == "txtDeptID")
{
FilterGridView.DataSource = lstDept.Where(x =&gt; x.DeptID == Convert.ToInt32(txtBox.Text));
FilterGridView.DataBind();
}

}
}



protected void lbRemoveFilterOutstanding_Click(object sender, EventArgs e)
{
FilterGridView.DataSource = LoadDepartmentData();
FilterGridView.DataBind();
}
}
}

References:
———–
http://www.codeproject.com/Tips/714411/ASP-NET-Gridview-with-Filter-in-Header

Posted in Uncategorized | Leave a comment

Linq Tutorial

Hi,

you can start learning LINQ from the below URL:

https://www.youtube.com/playlist?list=PL6n9fhu94yhWi8K02Eqxp3Xyh_OmQ0Rp6

Thanks,

Siddi.

Posted in Uncategorized | Leave a comment

2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

A New York City subway train holds 1,200 people. This blog was viewed about 6,200 times in 2014. If it were a NYC subway train, it would take about 5 trips to carry that many people.

Click here to see the complete report.

Posted in Uncategorized | Leave a comment

Microsoft Virtual Academy

Hi,

Please register for the free online Microsoft Virtual Academy training on ASP.NET MVC 4

http://www.microsoftvirtualacademy.com/liveevents/introduction-to-asp-net-mvc

And also look for the free online courses in Microsoft Virtual Academy

For example below is the link for the C# Fundamentals for Absolute Beginners

http://www.microsoftvirtualacademy.com/training-courses/c-fundamentals-for-absolute-beginners

Thanks,
Siddi.

Posted in URLs | Leave a comment

how to get the dll from GAC to local filesystem

Solution 1:
—————
Type a path beyond ‘C:\windows\assembly’ in the Run window. If you’re running .NET 2.0 or greater, try ‘C:\windows\assembly\GAC_MSIL’ and it will open up an explorer window to that folder. Do note that this method does not work from an open explorer window, but only the Run window.

References:
————–
Please refer this URL for other options http://blogs.msdn.com/b/johnwpowell/archive/2009/01/14/how-to-copy-an-assembly-from-the-gac.aspx

See the comment “Ross Beehler
14 Jan 2009 7:58 AM
#

Another way is to type a path beyond ‘C:\windows\assembly’ in the Run window. If you’re running .NET 2.0 or greater, try ‘C:\windows\assembly\GAC_MSIL’ and it will open up an explorer window to that folder. Do note that this method does not work from an open explorer window, but only the Run window.”

Thanks,
Siddi.

Posted in Misc Issues | Leave a comment

Cannot create/shadow copy ‘**dll name**’ when that file already exists.

Hi,

In order to resolve this issue there are two approaches.

Solution 1:
—————
Restart the IIS and Restart the AppPool in which the virtual directory exists.

Solution 2:
————-
You have to tell ASP.NET not to shadow copy the project assemblies to the ASP.NET temporary folders file by updating your web.config with the following entry:

<configuration>
   <system.web>
      <hostingEnvironment shadowCopyBinAssemblies="false" />
   </system.web>
</configuration>

Reason:
———–
By default shadow copy is enabled on every appdomain created by ASP.NET. Assemblies loaded will be copied to a shadow copy cache directory, and will be used from there. So that the original file is not locked and can be modified. An error you may encounter when running ASP.Net apps with the debugger is “Cannot create/shadow copy ‘XXX’ when that file already exists”.

References:
————–
1)http://www.c-sharpcorner.com/Blogs/3786/cannot-createshadow-copy-xxx-when-that-file-already-exist.aspx
2)http://ranafaisal.wordpress.com/2008/03/25/cannot-createshadow-copy-when-that-file-already-exists/

Thanks,
Siddi.

Posted in Misc Issues | Leave a comment