473,505 Members | 14,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Fomatting question. Date to String and back.

I have a simple Formview and in the InsertMode I have a calendar and a
textbox. All I want is for people to click on a date and the date is
populated to the textbox. Here is my simple code and my problem is
converting the DateTxtBox to a date format. Can someone show me how to do
this simple conversion?

Thanks!
Protected Sub Calendar2_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim CalDate As Calendar

CalDate = FormView1.FindControl("Calendar2")

Dim test As Date

test = CalDate.SelectedDate

Dim DateTxtBox As TextBox

DateTxtBox = FormView1.FindControl("DateTextBox")

DateTxtBox = test
End Sub
Oct 24 '06 #1
1 1121
Never mind, I figured it out.

Protected Sub Calendar2_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim CalDate As Calendar

CalDate = FormView1.FindControl("Calendar2")

Dim test As Date

test = CalDate.SelectedDate.ToString

Dim DateTxtBox As TextBox

DateTxtBox = FormView1.FindControl("DateTextBox")

DateTxtBox.Text = test
End Sub



"Phillip Vong" <phillip_vong*at*yahoo*dot*comwrote in message
news:u7**************@TK2MSFTNGP02.phx.gbl...
>I have a simple Formview and in the InsertMode I have a calendar and a
textbox. All I want is for people to click on a date and the date is
populated to the textbox. Here is my simple code and my problem is
converting the DateTxtBox to a date format. Can someone show me how to do
this simple conversion?

Thanks!
Protected Sub Calendar2_SelectionChanged(ByVal sender As Object, ByVal e
As System.EventArgs)

Dim CalDate As Calendar

CalDate = FormView1.FindControl("Calendar2")

Dim test As Date

test = CalDate.SelectedDate

Dim DateTxtBox As TextBox

DateTxtBox = FormView1.FindControl("DateTextBox")

DateTxtBox = test
End Sub


Oct 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1715
by: gsv2com | last post by:
Maybe I'm tired, but I'm having a small problem with a date function I'm writing. Total noobish I know, but this is just going beyond me for some reason... What I want to happen is send a date...
38
5002
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
2
1566
by: mirza i | last post by:
thanks for the previous replies. here is the new question (i'm absolutely sure that this should be VERY easy for a good js coder) ok: from asp i call: <img src="pics/cal.gif"...
2
1459
by: repairman2003 | last post by:
I'm trying to keep track of two objects, a vector of strings and a user defined date, ints set up in a struct. Having some trouble with it keeping track of the information though. //Defined as...
3
432
by: KevinD | last post by:
thank you for your helpful explanations. In my first note I forgot to mention that my simple flatfile is a text file with a newline character at the end thus I able to get an entire record . ...
2
8374
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
1
1533
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to...
5
3172
by: troy_lee | last post by:
I have a table that has a PK field with the following format: Dyymm123. So that, a typical number might look like this D0806270. The first character is literal and never changes. The next four...
25
4513
by: Brian | last post by:
I have a datetimepicker formated for just time, the user selects the time. I want to compare if that time is between midnight and 8 am dtmTime #11:59:59 PM# and dtmTime < #08:00:00 AM# this...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.