How to Show information / warnings in SharePoint


In SharePoint , Status bar is used to display information / warnings  using Javascript.This script is added at the client side.


The status script functions are listed out in the SP.UI.Status class. in SP.js which is added in master page by default.

The SP.UI.Status class has 6 functions.

           1. addStatus   – used to add the status bar information

           2. appendStatus  – used to append the information

           3. removeAllStatus – remove all  status

           4. removeStatus – remove status

           5. setStatusPriColor – used to set color for the status bar information

           6. updateStatus – update  / replage the status information

So simply follow the steps the to add the information / warning in SharePoint  site.


 1. Add a Script Editor / Content editor web part in the page



2. Edit snippet and add the below code to show the information.

window.onload = function(){

var Status;

Status = SP.UI.Status.addStatus(“Information : “, “ We sincerely apologize for the inconvenience.Our site is currently undergoing maintenance and upgrades and will return return shortly.“, true);

  SP.UI.Status.setStatusPriColor(Status, “yellow”);

  }


3. Save the page and refresh.


Now the page looks as below



Woo hoo , Now its very simple to show the notification for alerts/ warnings in SharePoint site.


For more info , refer https://goo.gl/45xmbX

Thanks for reading this article!! please leave your comments and suggestion about this article.

Advertisements

http error 503. the service is unavailable in IIS after enabling 32 bit application


By default, IIS running on a 64 bit computer does not support running a 32 bit application. However, you can change the setting in an Application Pool under which the application is running by setting the ‘Enable 32-bit Applications‘ to true

In IIS, I created a new web-site and change the application pool to enable 32-bit application to support my 32 bit application.

While accessing the apppplication i got the  “HTTP Error 503. The service is unavailable” error.

Also Identified that the application pool was stopped repeatedly when i tried to access the  application. Finally got the below error from event viewer.

The Module DLL ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

Solution:

Run the following command in Windows Command Prompt. 


"%systemroot%\system32\inetsrv\AppCmd.exe" set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64

This  will solve the problem to load SPNativeRequestModule when the application pool is running in Integrated Mode and 64-bit application mode.

Hope the issue solved !!

Thanks for reading this article!! please leave your comments and suggestion about this article.

Images and CSS not shown in website hosted in IIS Server 7.5


Recently I came across a unseen problem.

A website working perfectly While debugging using Visual studio 2010 . All the Images and CSS are loaded perfectly as expected.

However when I hosted the web site in IIS Server version 7.5 , CSS and Image files are not shown in the website.

After a long research , Finally found that the Static Content handler is not enabled in the IIS Server.

After Enabling Static content , issue got fixed. Now the Images and CSS are shown in the Website as expected.

To Enable Static content Handler :

1. Open Turn Windows Features On or Off

2. Select Internet Information Services

3. Then World Wide Web Services

4. Under Common HTTP Features Check the Static Content,

5. Click Ok.

iis

 

Thanks for reading this article!! please leave your comments and suggestion about this article.

Export gridview data to Excel document in asp.net C#


Follow the  steps involved :

Step 1:

Create a aspx page with a grid view control.

ViewExcelReport.aspx

aspx code

 Step 2:
Add the code for the button click in ViewExcelReport.aspx.cs

code

Now you are done, you can export the grid view in to Excel format.

if you’re getting any error message like

RegisterForEventValidation can only be called during Render();

To solve, add the overriding function VerifyRenderingInServerForm event in code. 

Thanks for reading this article!! please leave your comments and suggestion about this article.

 

Setting up a Subversion plug-in for Visual Studio 2008/2010


For Microsoft Visual Studio 2005, 2008, 2010 and 11 beta

Installation (2.1+)

 AnkhSVN 2.3.11269

  • Download AnkhSVN from  above download link. 
  • AnkhSVN is a free Subversion Client.
  • Run the AnkhSVN installer package (It automatically updates any previous versions).

Start using AnkhSVN from Visual Studio
Using an existing solution with AnkhSVN 2.1
  • Open your solution
  • If you are the first AnkhSVN 2.1 user of this solution
    • If glyphs do not appear automatically choose Tools -> Options -> Source Control and make sure AnkhSVN is the active source control provider.
  • Verify if the solution is connected to AnkhSVN
    • Right click the solution file. If you have an option that says ‘Add to Subversion’, your Solution is not connected yet
    • Click Add to Subversion and confirm adding the binding
    • If your project is not in an existing workingcopy you are now asked where to store your project
  • If some of the projects do not show glyphs
    • Check if the projects are connected in File -> Subversion -> Change Source Control
    • Make sure that at least the Solution and the projects missing glyphs are connected
      (Many project types do not require explicit binding)

Check out a Solution from Subversion
Using Open from Subversion
  • Select File -> Open -> Subversion Project
  • Choose a Url from the dropdown or click the globe icon to add a url
  • Browse to the solution of your choice
  • Click OK
  • In the next dialog select a local folder to store the project
  • Click OK and the solution will open automatically
Via the Repository Explorer 
  • Select View -> Repository Explorer.
  • When the tool window appears, choose the Plus-Folder icon to add your repository path and click OK.
  • Browse to the solution you would like to check out, right-click and choose Checkout Folder.
  • Browse to the location where you keep your working copy and press OK (you may need to create a directory first).
  • Open the solution inside Visual Studio. You will be asked whether to enable AnkhSVN for this solution, choose Yes.

Setting up a Subversion server in Windows using VisualSVN


Subversion is one of the widely used version controlling system amongst java developer community. Because of the flexibility and features that the Subversion provides, most of the developers have migrated to Subversion from CVS, which is another version controlling tool. If you want to setup a source controlling for your Java projects, you could install the Subversion core server and can create/manage data repositories directly from the command line. But if you want a Subversion product that just works out of the box, you need to have a look at the VisualSVN server.

VisualSVN Server – Subversion Server for Windows

VisualSVN is a free software that helps us to install and manage a Subversion server in Windows operating system. VisualSVN server comes with the core Subversion system, an Apache Server for running the Subversion server as Windows service and a visual management console. It also provides the access control for the subversion repositories, by creating users and groups.

Steps to setup a Subversion repository using VisualSVN server

  1. Download VisualSVN server and install it on your windows machine. When you install VisualSvn server, it also install the Windows service.
  2. Start the VisualSVN server Manager, which will open the repository browser.
VisualSVN - Subversion server for Windows

  1. To create a new repository for your project, right click on the Repositories and select ‘Create New Repository‘. This will ask you for the repository name. And, by default VisualSvn server will also creates the default folder structure (trunk,tag,branch) for your project.
    VisualSVN - Subversion server for Windows
  2. Once the repository is created, next step would be creating users and groups. To do this, right click on ‘Users’ and select ‘Create User’. Enter the user and and give password. Similar to this, you can create a group also and associate your user to the group.
    User creation: VisualSVN - Subversion server for Windows
  3. To give access to the repository for the newly created user, right click on the repository, select ‘Security’ and then from the ‘Properties’ window, click ‘Add’ to add users to our repository. Either a group or a user can be selected and added to the repository.
    VisualSVN - Subversion server for Windows
  4. After adding the user/group to the repository, the ‘access levels’ can be controlled from the ‘Properties’ window, as shown below.
    VisualSVN - Subversion server for Windows
  5. We are almost done. Now right click on your repository and select ‘Copy URL to Clipboard’ and share it with your fellow developers. This is your Subversion URL which can be accessed by other developers for checking out/checking in their code.