Friday, October 28, 2011

Changes in UI in SharePoint 2010

General Improvements:
  1. Reduce use of tables in HTML
  2. Cross browser support-IE, Firefox, Safari.
  3. UI upgradtion is separate frm database upgrade.
  4. Client object model- Javascript and silverlight.
  5. CSS is splited in multiple files and downloaded what are necessary only.
  6. Javascript can load when u need.
Master pages and Lay out:
  1. Application pages use dynamic master pages
The Ribbon:

  1. Always on the top of the page and fixed in that position even if u scroll the page.

Wednesday, October 26, 2011

How to Implement SQLServer authentication in asp.net?

To implement SQL Server authentication in asp.net, you have to change in web.config as well as in SQL server.
First go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 folder and execute InstallPersistSqlState.sql in the SQL Server. Just to let you know that it will create the ASPState database and the required stored procedures. Please check if you have .net 2.0 then check the corresponding folder.
Also if you do not want to create the default ASPState database then you can modify the script InstallPersistSqlState.sql and run that.
In the next step we have to modify the we.config for this. The main work is to change the session state mode, and the connection string.
If you are using windows authentication mode in SQL Server then you have to change web.config as below:

 <sessionState  mode="SQLServer" sqlConnectionString="Data Source=BSAHOO3SQLEXPRESS;Integrated Security=SSPI;"
        cookieless="false"
        timeout="60"
        />
If you are using SQL Server authentication mode then you have to change the web.config as below:

Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above

While I am trying to use sql server authentication mode, i got the following error
Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.
Cause: If your application is suppose .Net 4 then you need to take the InstallPersistSqlState.sql of the Framework64 version.
Solution: So go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and from there take the InstallPersistSqlState.sql, it will work fine.

Cannot drop database "ASPState" because it is currently in use

I got this error Cannot drop database "ASPState" because it is currently in use. while trying to uninstall ASPState database by using the UninstallPersistSqlState.sql script. Actually after install InstallPersistSqlState.sql, you can not directly uninstall the ASPState DB, so you need to run this commond (net stop w3svc) before uninstalling.
For this go to Start -> Run -> cmd and then in the command prompt type net stop w3svc as shown in the below figure. After that try to uninstall using UninstallPersistSqlState.sql.
net stop w3svc

Tuesday, October 25, 2011

Wish you all Happy Diwali !!!

--- Happy Diwali to all of U ---

Thursday, October 20, 2011

SharePoint 2010 powershell commands

Introduction:
In this article we will discuss about PowerShell commands which is introduced in SharePoint 2010. You can also visit Powershell command to install activate feature SharePoint 2010.

Description:
In MOSS2007 there was stsadm command line tool to work with MOSS2007, but in SharePoint it comes with Windows PowerShell to work with SharePoint 2010. This commadline tool will be available after  SharePoint 2010 Products. The commands are know as cmdlets in powershell language.

To access power shell go to Start -> All Programs ->  Microsoft SharePoint 2010 Products

How to close the current tab in the browser in c#.net?

For this post, I am really thankful to Mr. K.Kathiravan, for finding the solution for closing the current tab of the browser with asking any confirmation. I need to close the current tab (if only one tab open then need to close the browser) while user click on a link (take an example of log out). I also do not want any confirmation message before closing that, since our requirement is to close the browser in any case.

Here is the code that I have written in the page load and it works for me.
Response.Write("<script language='javascript'>window.open('','_self');window.close();</script>");

Wednesday, October 19, 2011

Dot net walkin bangalore

Dot net walkin both windows and web based application is conducting in bangalore. Please see the details below:
Date: Saturday, 22 Oct 2011 
Experience: 2-5 years Relevant Experience
Windows Application Developers: C# & MS SQL Server
Web Application Developers: C#, ASP.net & MS SQL Server
EXPERIENCE IN WCF AND CRYSTAL REPORTS WILL BE AN ADDED ADVANTAGE

Time: 10 AM - 4 PM
Contact:
Sheorey Digital Systems Ltd.
Software Lab & Technical Support Center
41, HAL Airport Main Road
3rd Floor (Above Spencers)
73, Konena Agrahara
Bengaluru 560 017. India
Phone no: 080-25036000

Tuesday, October 18, 2011

Create event receiver in Sandboxed solution is SharePoint

We can create an event receiver using visual studio 2010 in SharePoint 2010 in Sandboxed solution. That event receiver can do something like, your event receiver can add items to a list when the feature is activated.
Steps:
For this first open visual studio 2010 then go to File -> New Project then select an Empty SharePoint Project, give a proper name and click on OK. Then in the SharePoint customization wizard give the local debugging url and choose the option Deploy as a Sandboxed solution then click on Finish.

Now our empty sharepoint project is ready and we need to add a Feature. For this right click in the Features folder in the solution and Add Feature, your Feature.feature is successfully created as shown in the figure below.

Now in the next step we will add the event receiver. For this right click on Feature1 then Add Event Receiver

Sunday, October 16, 2011

Microsoft Enterprise Library 5.0 for data access

I always prefer to use Microsoft Enterprise Library rather than classic ado.net approach. Now the latest version of Microsoft Enterprise Library is 5.0. For previous versions you can check this article.
In the very first step you have to download Microsoft Enterprise Library 5.0 from the Microsoft site. Then install the .msi file. After that you will get all the dlls from the installation directory. I am here only describing how to use Microsoft Enterprise Library for data access.
You will need the below dlls:
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.Interception.dll
You have to give all the references for the above dlls in the Bin folder. Then follow from Step 3 onwards from this URL.

Friday, October 14, 2011

Customization of quick launch with flyout in sharepoint 2010

In this post we will discuss about how to do Customization of quick launch with flyout in sharepoint 2010. Thanks to Ramya Sekar for this post !!!

Also you can check out:

- Change page layout programmatically SharePoint 2010

- Enable Sign in as Different User Option in SharePoint 2013

- Introduction to SharePoint 2013 REST service

We can see the menus with flyouts option in many popular sites. In sharepoint its possible with the following steps

Step-1:
Create a site in SharePoint 2010

Step-2:
Goto SiteAction-> Edit in SharePoint Designer.Under the navigation click Master Page.Then select your master page:

Step-3:
Edit the file and go to the code of that master page
Identify the following tag

Change the value of StaticDisplayLevels to 1 and MaximumDynamicDisplayLevels to 1
Then Click save to save the changes.

Step-4:
Open the site again to see the changes.

Step-5:
We can set more pages with different heading as navigation by
Goto SiteAction -> SiteSetting
Under the Look and Feel Click quick launch

I create New Heading Requirement Details with the link Testing as follows

By this way we can create several headings with several flyouts in sharepoint site.

asp.net openings

For asp.net openings please check the image below. Job description, job location and experience details all are present. This is a direct walkin and you have to put my employee id: 112971 and Name: Bijaya kumar Sahoo. This is a walkin for 3.5 years to 5.5years.


Java openings for experienced professionals in bangalore

Java J2ee with Spring Hibernate walkin.
Java J2ee with Struts Walkin. All the walkins are for 3.5 years to 5.5 years.
For java openings please check the image below. Job description, job location and experience details all are present. This is a direct walkin and you have to put my employee id: 112971 and Name: Bijaya kumar Sahoo.

Tuesday, October 11, 2011

JavaScript validation for AJAX HTML editor

As I told before I am very weak in JavaScript, still I am trying to do some validation using JavaScript. Here in this example I am using JavaScript to check wether AJAX html editor is empty or not. If it is empty, it will show content can not be empty. In my project I have a master page, but I am putting the validation in a different page.
The Javascript function I have written inside
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script language="javascript" type="text/javascript">
        function validateposting() {
            var strtitle = document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").value;
            var a = $find("<%=Editor1.ClientID%>");
            var value = a.get_content();
            if (document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").value == "") {
                document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").focus();
                alert('Title is required');
                return false;
            }
            if (value == "") {
                alert('Content is required');
                return false;
            }
        }
 </script>

Wednesday, October 5, 2011

Disable browser back button

I got a schenario where after log out, I do not want any one to come out to my page. You simply need to write the code below the <head> tag
<script type="text/javascript" language="javascript">
            javascript:window.history.forward(1);
    </script>

Tuesday, October 4, 2011

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

I got the error "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack" in a Response.Redirect(" http://www.sharepointdotnet.com/ "). My code is in try catch block as below.
try
{
Response.Redirect("http://www.sharepointdotnet.com/ ");
}
catch (Exception ex)
{
//I am getting the exception here.
}
Cause:
Because Response.Redirect("Ur URL") usually internally calls the Response.End() and this internally calls the Thread.Abort() which internally tells the stack to end the thread.

Resolve: