c#

Get 404 Status Code from Custom Error Page.

Scenario We had to figure out how many pages in our site are broken (throwing 404 status code). But the problem was that we implemented a custom designed error page for broken ones. This page was designed in the context of site look and feel, so we associated the site master page as well with this Get 404 Status Code from Custom Error Page.

Call Hierarchy : A handy feature in Visual Studio 2010

Suppose we have a solution that contains different dependent projects. We can face 2 most common situation here: Situation 1: We have a method that we need to change by modifying the definition of that method or just we want to check that which other methods are calling this method. Situation 2: We have a Call Hierarchy : A handy feature in Visual Studio 2010

Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies…

I have a solution that contains SharePoint dll’s reference. Whenever I run the solution, start page get crash and show me this error. “Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” Well every time I run Resolved: Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies…

Resolved: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

During my SharePoint project i need to clean up the site for better performance.  So first thing i started to delete the closed web parts from web part pages. As there were so many web part pages in the application so i decide to write a web application that can delete the closed web parts Resolved: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

Common errors with SharePoint 2010 development using Visual Studio 2010 in x64 architecture: Resolved

“The type or namespace name ‘SharePoint’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?” (Even you add Microsot.SharePoint.dll reference in your project and import the namespace in code but while building the solution you will get above mentioned annoying error.) OR “FileNotFoundException was unhandled: The Web application at http://localhost/ could Common errors with SharePoint 2010 development using Visual Studio 2010 in x64 architecture: Resolved

Resolved: COM DLL is not showing in COM Library after Registering on Windows Server 2008 x64

Well I had to implement a payment gateway at my server. My server was built on x64 architecture and had Windows Server 2008 installed. Well according to the document I had to put my COM dll inside c:\windows\system32 folder and then from Run command I had to register this dll like “regsvr32 c:\windows\system32\MyCOM.dll”. Well I Resolved: COM DLL is not showing in COM Library after Registering on Windows Server 2008 x64

Get HTML of a web page using C#.NET

Below i am using a function that takes a web page full url as string and return back HTML of that page as string. You can use this returned HTML in your code as per your requirement. Step 1: First import 2 namespaces that are required by this function to work. using System.IO; using System.Net; Get HTML of a web page using C#.NET

Programming Tips for .NET Guys !

1. How to handle single quote (‘) during insertion and updation ? Suppose there is a text box in form and you want to handle single quote ( ‘ ) during insertion and updation. string StrValue=this.TextBox1.Text; StrValue=StrValue.Replace(“‘”,”””); 2. How to handle maximum length in multi line text box ? Suppose there is a multi line text Programming Tips for .NET Guys !

Static Classes and Static Class Members in Microsoft.NET

Static Classes and Static Class Members    Static classes and class members are used to create data and functions that can be accessed without creating an instance of the class. The data and functions do not change regardless of what happens to the object. Static Classes A class can be declared static, indicating that it Static Classes and Static Class Members in Microsoft.NET

Properties and Indexers in Depth

All the object-oriented languages support encapsulation, inheritance and polymorphism. What is different about C# is that it supports additional features like properties, events, indexers, delegates, etc. That is why C# is often termed as a modern object-oriented (OO) language. In this article we will discuss two modern OO concepts—properties and indexers. Properties Properties provide an Properties and Indexers in Depth