How to remove space from string in asp.net

{0 Comments}

How to remove space from string in asp.net

To remove space from the string you can use replace method. There are two parameters which you have to pass to replace the space from the string. on is the character which you want to remove and other is the character which used in place of space. Following is the syntax which you can used …

Read More…

How to set autofocus textbox using JavaScript

{0 Comments}

Following is the JavaScript code which will help you to set focus on text box, on every page loaded. Just keep in mind to change your text box id in get element id function. Except this all you have to add following script in your head or below the body tag.   Javascript |  copy code |? 1<script type="text/javascript">2 window.onload = …

Read More…

How to add calendar extender in textbox asp.net

{0 Comments}

How to add calendar extender in textbox asp.net

See the following step and see how easily you can add calendar extender or calendar to text box in asp.net.  First insert a script manager. Insert a text box in web form Add calendar extender. As shown in following image. Or have look on source code of the page.  HTML |  copy code |? 1 2 <asp:ScriptManager ID="ScriptManager1" runat="server">3 </asp:ScriptManager>4 …

Read More…

background image textbox asp.net

{0 Comments}

A simple setting to change apply background image of textbox in asp.net. You can set style in internal and external style sheet. Or just use your textbox inline css code in asp.net.  HTML |  copy code |? 1<asp:TextBox id="TextBox1" runat="server" style="background-image: url( images/textbox.gif ); border: none;" />

Read More…

Allow html in textbox asp.net

{0 Comments}

In most of cases when you use textfield or textbox and some one enter a html code like<> then its through an error. The reason for that Is asp.net by default stop cross-site-scripting method to avoid hacking or high jacking of application. Then you can allow html in textbox in asp.net by setting  HTML |  copy code |? 1<%@ Page …

Read More…

Auto complete textbox asp.net

{0 Comments}

In this post you will know how to add an Ajax auto complete feature to a textbox in asp.net using c#. Some point which you must remember before applying Ajax to your asp.net form.  There must a script manager on the page  Only one script manager is allowed per page.  Ajax toolkit dll file should …

Read More…

Allow only numbers in textbox asp.net

{0 Comments}

You can restrict a text box to get numeric/numbers only, for this the best way is to apply regular expression check point. For regex validation you can choose one of two (code behind and designer mode) validating method according to your use. The most important thing is the correct regular expression which truly validates your …

Read More…