ASP.NET

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.

Resolved: An unexpected error with a provider-hosted app for SharePoint

Scenario: You developed and hosted an ASP.NET  MVC site on IIS and planning to consume this provider-hosted app in SharePoint. When accessing standalone, the MVC site is working fine but when installing and called from SharePoint, it throws an error “An unexpected error has occurred. Please try again by launching the app installed on your Resolved: An unexpected error with a provider-hosted app for SharePoint

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.

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

File Download from SharePoint Document Library in Forms Based Authentication Scenario

I was writing the code for downloading a file from a SharePoint document library using Forms Based Authentication. Every time file was getting downloaded with 8kb of size when i was opening them they were showing that file is not supported. I opened one of downloaded files that was actually a word file, in notepad File Download from SharePoint Document Library in Forms Based Authentication Scenario

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