Showing posts with label Windows Presentation Foundation. Show all posts
Showing posts with label Windows Presentation Foundation. Show all posts

12 December, 2011

ASP.NET Textbox Selectall() property



12-Dec-2011


I am currently writing a form where I needed to highlight and select all text in a textbox when it is selected (onfocus), cause that is what user will be doing: copy and paste, so that in effect requires selecting the whole text string currently in the textbox, to replace it with new value.


I got two answers from my search routing, server side, and client side, and that is coming from a single article.


Here’s how:


In Page_Load event, add below code:


myTextBox.Attributes.Add("onfocus", "this.select()")


The other way is what I tested, and it worked, so I assume above works as well:





Hoe this helps you, as it did me.


Till then. Ciao!


Reference: selectall() property in C# for textbox control



Enhanced by Zemanta

15 February, 2011

Out for the week

The old .NET Framework logoImage via WikipediaI am on external course for the whole week, brushing up on my .NET knowledge.

As it turns out, I really need to have a refresher course: a lot I've already forgotten, and many I have ignored. I have picked up a few things to "enhance" the performance of my existing applications, and a few more things to help me develop better applications in the future.

Hopefully, the whole-week course is really going to be a boost in my coding skill.

Till then...

Enhanced by Zemanta