Hi

My scenario is I have on text box with date (dd-MM-yyyy). I am using ajax in this text box.

I need this date display into another text box with format yyyyMMdd on click the button

Because the invoice no Need the yyyyMMdd-00001 when the user select the date.

How can do this.

Me.txtSoNo.text=me.txtSODate.text.tostring("yyyyMMdd")

error is

System.FormatException: Input string was not in a correct format.

Pls advice me how to do it

maideen

You should have to use System.DateTime type.

Dim newDate = DateTime.ParseExact("20111120", 
                                  "yyyyMMdd",
                 CultureInfo.InvariantCulture)

Me.txtSoNo.text=newDate.ToString("yyyyMMdd")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.