David Birin's blog
Does i+me == i++ ???
Browse by Tags
All Tags
»
C#
(
RSS
)
ASP.NET
DEV
Embedded Resources
Hebrew
IIS
JavaScript
MOSS
SharePoint
WSS
XSL
C# anticelebrities – Part 1 – The ?? operator
I decided to start a new series of posts on the anticelebrities operators / keywords of C#, being anticelebrity for a keyword / operator means that it’s not widely used by programmers. Some may say that main purpose of the members in the anticelebrity club is to be used in tricky interview questions, I hope that I will give them a push towards celebritness by explaining how to use them, at the worst case you will have some geek trivia questions for your next coffee break. The ?? operator...
Embedded resources in XSL files
If you ever worked with embedded resources you probably know the required steps for embedding resources: Setting the build action to “Embedded Resource” in the file properties. Adding a web resource attribute with the file (best practice is to add this line in the AssemblyInfo.cs file) the first parameter is the default project namespace + the filename and the second parameter is the mime-type: [assembly: WebResource( "Namespace.Filename.gif" , "image/gif" )] The WebResource attribute...
SharePoint – Events are duplicated when using templates
I encountered a strange behavior in SharePoint, this phenomenon happens when you create an event handler and attach it to a list template (for example, a document library) using a web-site level feature. If you save the list as template, the event handler reference is saved inside the list template (STP file) and when you create an instance using the template it can cause the following problems: The event handler will be activated automatically on a web site where the feature is not enabled. If the...
SharePoint – Add a SPField to all the content types in a SPList
I found out (another) strange behavior of SharePoint, I tried to add a field (a column) to a list which contain more than one content type using the following code (the new field name is “New Field”) : using (SPSite currentSite = new SPSite( "http://moss" )) { using (SPWeb currentWeb = currentSite.OpenWeb()) { SPList currentList = currentWeb.Lists[ "DocLib" ]; SPField newField = currentList.Fields.CreateNewField(SPFieldType.Text.ToString(), "New Field" ); currentList...
SharePoint - Internal field names in Hebrew
A field (sometimes called a column) in SharePoint - represented in the object model by the SPField class, has two main properties which are used to identify it in code, the Title property and the InternalName property, the reason for the duplication is that the Title property can be changed from the GUI or translated into other languages, therefore if we want to write code which can be used without recompiling after every field name change in the GUI or recompiling for different languages we will...
How to create an application in IIS6 using C#
Before the IIS7 era, we had no API for directly manipulating IIS, but we still needed to perform some actions like creating a virtual directory or an application (mostly used in installations). Creating an application using the IIS GUI is done in the following way: Creating it in code is a more complex task which is dived into 3 parts: 1. Finding the website in the IIS which we want to create the application underneath: /// <summary> /// This function looks for the path of a web site...
Search
Go
This Blog
Home
Tags
ASP.NET
C#
DEV
Embedded Resources
Entity Framework
Excel Services
Hebrew
IIS
Internet Explorer
JavaScript
MOSS
SharePoint
SharePoint Designer
SQL
T-SQL
WF
Workflow activity
WSS
XSL
Navigation
Home
All Posts
RSS
Popular Tags
Archives
January 2010 (1)
November 2009 (1)
July 2009 (1)
June 2009 (1)
May 2009 (1)
March 2009 (1)
January 2009 (3)
December 2008 (2)
July 2008 (2)
Syndication
RSS
Atom
Comments RSS