Sikrarin Tachaworapatana Sikrarin Tachaworapatana - 5 months ago 10
Vb.net Question

I want to set default text in text box.When user type something default text will appear too like

I want to set default text in text box. When user type something default text will appear too like default text is:

C:\Users\admin\Desktop\ ..... .jpg


When user type something in text box as 1 result will show:

C:\Users\admin\Desktop\1.jpg


Thank

Answer

I think you are looking for the placeholder attribute. Use it like any other attribute inside your ASP.net control:

<asp:textbox id="txtWithHint" placeholder="C:\Users\admin\Desktop\ .....  .jpg " runat="server"/>

At your server side code, append the text entered by user like this.

Dim userInput As String = 
                  String.Format("C:\Users\admin\Desktop\{0}.jpg", txtWithHint.text)

I hope this will resolve your problem.

Comments