WebHosting

Sunday, December 11, 2011

Content Types

Content types are a fundamental concept of SharePoint foundation. Any data that you put inside
SharePoint gets associated with some content type. Any content type gives you a number of reusable
settings. The reusable settings consist of the structure of information, associated workflows, information management policies, field rendering templates, and in the case of documents—document information panels and document formats and templates.
As an example in your organization, you may produce proposals for clients or software defect bug
reports. It is possible that both of these are Word documents, but their meanings are quite different. The workflows that they need to be routed through are quite different and the associated collected metadata on each of these can also be quite different. Therefore, it makes sense to differentiate between them as their own content types.

ADO.NET Data Services and REST

ADO.NET Data Services is yet another way for you to access your SharePoint data at client side. Under
this technology you would use patterns and libraries that make data accessible over simple HTTP-based
technologies. This means that you can access the data over simple HTTP-based URIs and use of
standard HTTP verbs such as GET, PUT, POST, and DELETE. Data is fetched in JSON or ATOM formats,  so it is portable across all platforms.

Thursday, December 8, 2011

New APIs in the Windows 7 Shell

This document lists reference topics that have been added for the Windows 7 release. These documents are entirely new. Some older material not listed here also contains new Windows 7-specific content, such as new enumeration, constant, and flag values.

Interfaces

How to Register DLL Control Panel Items


Control Panel items that are implemented in a DLL that exports the CPlApplet function have different registration requirements than .exe files. For Windows XP and later systems, new Control Panel item DLLs should be installed in the associated application's folder under the Program Files folder. Items that are stored in the System32 directory with a .cpl extension do not need to be registered; they are automatically shown in the Control Panel. All other Control Panel items usingCPlApplet must be registered in one of two ways:
  • If the Control Panel item is to be available to all users, register the path on a per-computer basis by adding a REG_EXPAND_SZ value to theHKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Cpls subkey, set to the DLL path.
  • If the Control Panel item is to be available on a per-user basis, use HKEY_CURRENT_USER as the root key instead of HKEY_LOCAL_MACHINE.
The following two examples register the MyCplApp Control Panel item. The DLL is named MyCpl.cpl and is located in the MyCorp\MyApp application directory. This first example illustrates per-computer registration.
Instructions
Step 1:
Add this information to the registry to register the existence of the .cpl file.
HKEY_LOCAL_MACHINE    Software       Microsoft          Windows             CurrentVersion                Control Panel                   Cpls                      MyCpl = [REG_EXPAND_SZ] %ProgramFiles%\MyCorp\MyApp\MyCpl.cpl


How to Register Executable Control Panel Items

 
image

For Control Panel items that are implemented as .exe files, no special exports or message handling is required. Any .exe file can be registered as a command object to appear with an entry point in the Control Panel folder.
An example is used here to demonstrate the registration requirements. The example shows how to register a Control Panel item called My Settings as a command object so that it appears in the Control Panel window. The My Settings window also appears when the command MyApp.exe /settings is run.
Instructions
Step 1:
Generate a GUID for the Control Panel item. The GUID uniquely identifies the Control Panel item. In this example, {0052D9FC-6764-4D29-A66F-2F3BD9E2BB40} is the GUID of the Control Panel item.
Step 2:
Using the GUID as a name, add a subkey to the registry as follows.
HKEY_LOCAL_MACHINE    
SOFTWARE       
Microsoft         
 Windows              
CurrentVersion                
Explorer                   
ControlPanel                       
NameSpace                          
{0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}                            
(Default) = My Settings

The data for the Default entry is simply the REG_SZ name of the Control Panel item. The Default entry can be useful to identify the GUID entry, but it is optional.
Step 3:

Using the GUID as a name, add a subkey and its entries to the registry as follows.
HKEY_CLASSES_ROOT    CLSID       {0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}          (Default) = My Settings          LocalizedString = @%ProgramFiles%\MyCorp\MyApp.exe,-9          InfoTip = @%ProgramFiles%\MyCorp\MyApp.exe,-5          System.ApplicationName = MyCorporation.MySettings          System.ControlPanel.Category = 1,8          System.Software.TasksFileUrl = %ProgramFiles%\MyCorp\MyApp\MyTaskLinks.xml


  • Default. REG_SZ. The display name for the Control Panel item.
  • LocalizedString. Optional. REG_SZ or REG_EXPAND_SZ. The module name and string table ID of the localized name of the Control Panel item. The format is an "at" sign (@) followed by the name of the .exe or .dll that contains the Multilingual User Interface (MUI) string table. Environment variables can be used as a substitute for a part of the path. The path and file name is followed by a comma (,) and a hyphen (-), followed by the ID in the string table.
    If the module does not have a string table, then this entry can simply be the display name string. If you use only the display name string rather than a string table, the name does not adjust to the current display language.
  • InfoTip. REG_SZ or REG_EXPAND_SZ. A description of the Control Panel item. This information is shown in an InfoTip that is displayed when the mouse hovers over the item's icon. The syntax is the same as that used for LocalizedString, including the option of simply providing a string rather than a string table reference.
  • System.ApplicationName. REG_SZ. The canonical name of the item. The command of form control.exe /name System.ApplicationName opens the item; for example, control.exe /name MyCorporation.MySettings. See Executing Control Panel Items for more information on the use of Control.exe.
  • System.ControlPanel.Category. REG_SZ. A value that declares the Control Panel categories where the item appears. Multiple categories are separated by commas. In the case of the example above, the entry specifies that the My Settings item should appear in both the Appearance and Personalization andPrograms categories. See Assigning Control Panel Categories for possible category values.
  • System.Software.TasksFileUrl. REG_SZ or REG_EXPAND_SZ. The path of the XML file that defines task links. This can be a direct file path as shown in the example, or an embedded resource specified as a module name and resource ID such as "%ProgramFiles%\MyCorp\MyApp\MyApp.exe,-31".

Step 4:

Under that same GUID subkey, add the following subkey to the registry to provide the path of the file that contains the icon and the resource ID of the image within that file.
HKEY_CLASSES_ROOT     
CLSID      
 {0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}         
 DefaultIcon           
  (Default) = %ProgramFiles%\MyCorp\MyApp.exe,-2

Note that while the syntax is otherwise similar to the LocalizedString and InfoTip entries discussed earlier, no '@' character is used as a prefix in the REG_SZ or REG_EXPAND_SZ entry that specifies the path.
Step 5:

Add the following information to the registry to provide the command that is called by the system when the user opens the Control Panel.
HKEY_CLASSES_ROOT     
CLSID      
 {0052D9FC-6764-4D29-A66F-2F3BD9E2BB40}        
  Shell           
  Open              
  Command              
     (Default) = [REG_EXPAND_SZ] %ProgramFiles%\MyCorp\MyApp.exe /Settings

How to Make Server Controls Browser Compatible Using ASP.NET

Introduction

In modern web development, we need to check the browser compatibility for our web pages. This can include changing the css styles for design issues. Using ASP.NET we can check the browser compatibility without writing a single line of code for the server controls.

Let's check out some code samples:
If we will define css classes like:
.IEStyle{color:Red;}
.FFStyle{color:Blue;}
.DefaultStyle{color:Black;}

Create a Label control in your page.
Label control:

<asp:Label ID="lblTest" runat="server" ie:CssClass="IEStyle"

mozilla:CssClass="FFStyle" CssClass="DefaultStyle" ie:Text="You are in Internet 

explorer." mozilla:Text="You are in Firefox." Text="You are in other browser." 

/>

Getting started with MongoDB

First download the MongoDB binaries from the following site - http://www.mongodb.org/downloads and unzip the downloaded binaries to a folder of your choice. Now you have to create a folder where MongoDB can store the data. This won't be created automatically.

Execute the following command in your shell:

C:\> mkdir \data

C:\> mkdir \data\db

At the last step, lets run MongoDB. Navigate to your MongoDB folder and execute the mongod.exe:

C:\> cd \my_mongo_dir\bin

C:\my_mongo_dir\bin>mongod

Now we are ready to start. If you want to open the shell admin console, use the following command:

C:\my_mongo_dir\bin>mongo

You can also use the web-based admin console - http://localhost:28017/

A detailed guide can be find on the following site -http://www.mongodb.org/display/DOCS/Quickstart+Windows

Working with NoSQL Databases

How to get started with NoSQL?

Since 2009 NoSQL databases becomes more and more popular. But why?

  • No usage of SQL, that means
    • Less complexity
    • Better portability
    • Boundlessness
    • User-friendliness
  • Most databases are Open-Source
  • Performance
  • Scalability

Famous companies like Twitter, Facebook and Amazon are using NoSQL databases.
What sorts of NoSQL databases are used today?

  • Key-Value stores
    • Easy to implement
    • Only key-value-pairs can be stored
    • Difficult to build complex data structures
  • Column stores
    • Columns don't have to be defined in advance.
    • A row can have different numbers of cells
  • Document stores
    • Like key-value stores, but allows nested values
  • Graph databases
    • Objects and relationships are modelled and persisted as nodes and edges of a graph

What NoSQL databases are present today?

Wednesday, December 7, 2011

Html32TextWriter C#

Writes a series of HTML 3.2–specific characters and text to the output stream for an ASP.NET server control. The Html32TextWriter class provides formatting capabilities that ASP.NET server controls use when rendering HTML 3.2 content to clients.

using System.IO;
using System.Web.UI;
namespace Examples.AspNet
{
public class CustomHtml32TextWriter : Html32TextWriter
{
// Create a constructor for the class
// that takes a TextWriter as a parameter.
public CustomHtml32TextWriter(TextWriter writer)
: this(writer, DefaultTabString)
{ }
// Create a constructor for the class that takes
// a TextWriter and a string as parameters.
public CustomHtml32TextWriter(TextWriter writer, String tabString)
: base(writer, tabString)
{
}

Control.ClientID Property for asp.net control

Gets the control ID for HTML markup that is generated by ASP.NET


<asp:Label ID="SelectedSport" runat="server" ClientIDMode="Static">

ASP.NET provides multiple algorithms for how to generate the ClientID property value. You select which algorithm to use for a control by setting its ClientIDModeproperty. The algorithms are identified by the ClientIDMode enumeration values that are listed in the following table.

ASP.Net Control Properties


Name
Description
Gets the browser-specific adapter for the control.
Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.
Infrastructure. Gets the control that contains this control's data binding.

Gets a value that indicates whether the server control's child controls have been created.

Featured Posts

OBS Browser Source Not Working? How to Interact With Web Pages Inside OBS Studio

If you're using OBS Studio to display a website, YouTube page, dashboard, live poll, chat widget, or web application, you may notice so...