Creating waterMark textbox by using ASP.net Ajax control tool kit


Asp.net ajax tool kit have make it very much easy to create a watermarked control. Its just a matter of few lines of code and steps. To create watermarked textbox using Asp.Net Ajaxcontroltoolkit follow the steps below :

Step 1. First add the ToolkitScriptManager control to the page. this ToolkitScriptManager is very important without adding this control the page will not accept any ajaxtoolkit control.

Step 2. then add the asp.net textbox control to the page. suppose the control id is txtMemberName

Step 3. add the TextBoxWatermarkExtender control on the page. and set the TargetControlID property value to txtMemberName (or any other that targated to make as watermark) and set the WatermarkText property to text that wanted to show as water marked text.

Thats all, after running this page it will show a textbox with water marked text, but the style is not like water marked. To make it more attractive as water mark text box have to add some style in the property WatermarkCssClass.

The source code block that I have used in my test to create water marked text box is like below :

<style>

 

.waterMark

{ height: 16px;

width: 168px;

padding: 2px 2 2 2px;

border: 1px solid #BEBEBE;

background-color: #F0F8FF;

/* color: gray;*/

font-size: 8pt;

text-align: center;

}

</style>

 

<asp:ToolkitScriptManager ID=”ToolkitScriptManager1″ runat=”server”>

</asp:ToolkitScriptManager>

<asp:TextBoxWatermarkExtender ID=”txtWaterMarkMemberName” WatermarkCssClass=”waterMark” WatermarkText=”enter member name” TargetControlID=”txtMemberName” runat=”server”>

</asp:TextBoxWatermarkExtender>

<asp:TextBox ID=”txtMemberName” runat=”server”></asp:TextBox>

 

 

Advertisements

How to run console application from another application


I was working on some project that required to call and run another console application. And I used the following code to run the console application from my application :
System.Diagnostics.Process oprocess = new Process();
oprocess.StartInfo.FileName = @”C:\Developments\TestConsoleApplication\TestConsoleApplication\bin\Debug\TestConsoleApplication.exe”;
oprocess.Start();

 oprocess.StartInfo.FileName takes the path of the console application.

Got Microsoft Community Contributor Award 2011


I am very pleased to inform and mention that I got “Microsoft Community Contributor Award 2011”  for the contributions to Microsoft online technical communities.Actually its always amazing that you are doing something and its recognized. After getting that award mail I was very happy and feeling proud. Definitly this recognition will inspired me to go forward and to contribute more. Also it makes some dream to get something better.

The award mail from microsoft was something like :  “Dear Contributor,
Congratulations! We’re pleased to inform you that your contributions to Microsoft online technical communities have been recognized with the Microsoft Community Contributor Award. ……………………………”

They provide me a certificate regarding this award.

Microsoft® Community Contributor Award

Microsoft® Community Contributor Award Certificate

How to create sql Login by script.


To create sql login user follow the scripts below :

First have to login to sql management studio with other user who have the permission to create user or by Windows authentication

and then run the following scripts :

CREATE LOGIN DesiredUserName WITH PASSWORD = 'DesiredUserPassword';

Now to map this login user to a database use the following script:

USE  dbNewDB
 GO
 CREATE USER DesiredUserName FOR LOGIN DesiredUserName WITH DEFAULT_SCHEMA=[dbo]
 GO       
 GRANT CONNECT,CONTROL to DesiredUserName