Thursday, April 29, 2010

How to get NT AUTHORITY\Authenticated Users group using .NET object model

Yes obviously I can hard code a string constant for the value and use the string "NT AUTHORITY\Authenticated Users but I hate hard coding values if the object model is rich enough to provide me a way.

Following method will return NT AUTHORITY\Authenticated Users group as a string

public static string GetNTAuthenticatedUsers()
return new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null).Translate(typeof(NTAccount)).Value;

Wednesday, April 28, 2010

Global Assembly Cache goes empty

While doing the development on a SharePoint machine, it is frequent to deploy the dlls in GAC and resetting the IIS or recycling the application pool. one day the GAC goes empty and all of us sudden we are not able to deploy the library to the GAC. It had a solution of restarting the development machine but this issue is frequent among the team members

Solution for this is to navigate to Start-> Run - >services.msc and find "Indexing services" stop/restart the service and reopen the assembly window. There you go . .. .

Fix : Location.href not working in IE 6

We recently tried to do a post back of a page based on a user input in a text box, the postback will be triggered by a ASP LinkButton. ASP Linkbutton renders as an anchor tag with the href populated with javascript:WebForm_DoPostBackWithOptions. So the challenge is to set the window.location to the javascript:WebForm_DoPostBackWithOptions

window.location= javascript:WebForm_DoPostBackWithOptions .. . ..

The location can be a URL too, in our case it is just a post back script

It works like a charm in IE 8 but it doesn't even show a sign in IE 6. We tried many variations window.location=, window.location.href= ,window.location.href.assign but nothing worked out.

After few hours of googling and surfing the web we found that we need to add the following line to get it worked in IE 6


At last the final code looked like this

if (evt.keyCode == 13)
window.event.returnValue = false;
window.location = '";
return false;

hope this helps someone .. .

Tuesday, April 20, 2010

Silverlight on Symbian platform

While Adobe is still struggling to get it Flash to iPhone platform, Microsoft released silverlight for Symbian platform. this will enable Nokia S60 5th edition to display silverlight content. As Microsoft already enable Silverlight in its mobile operating system now it is extending the technology to another open source smart phone platform.

check out the Nokia beta labs here