|
-
May 5th, 2004, 03:31 PM
#1
Thread Starter
Frenzied Member
Custom DatePicker Control
I am creating a custom datepicker and everything is working fine except. I can't seem to access the textboxes clientID.
In my custom control I have a textbox and an image, which is a link.
I need to pass the textboxes ClientID with this link, but I can't seem to get it.
Here's my code
VB Code:
Protected Overrides Sub CreateChildControls()
Controls.Clear()
JHATextBox = New TextBox
JHATable = New Table
JHARow = New TableRow
JHATextCell = New TableCell
JHAEmptyCell = New TableCell
JHAImageCell = New TableCell
JHATextCell.Controls.Add(JHATextBox)
[color=red]JHAImageCell.Text = "<a href=""javascript:LookupDate(Form1, " & Me.JHATextBox.ClientID & ", document.forms[0]." & Me.JHATextBox.ClientID & ".value)""><img alt=""Show Calendar"" src=""/Common/images/btn_calendar.gif"" border=""0"">"[/color]
JHARow.Cells.Add(JHATextCell)
JHARow.Cells.Add(JHAEmptyCell)
JHARow.Cells.Add(JHAImageCell)
JHATable.Rows.Add(JHARow)
Controls.Add(JHATable)
End Sub
I have tried JHATextBox.ClientID as well, but I still can't get the clientID of the textBox control.
Any ideas?
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
May 5th, 2004, 04:51 PM
#2
Thread Starter
Frenzied Member
I got it fixed. I couldn't access the ClientID (UniqueID) until the control was added to the page, so I had to modify the code to this and replace ClientID with UniqueID.
VB Code:
Protected Overrides Sub CreateChildControls()
Controls.Clear()
JHATextBox = New TextBox
JHATable = New Table
JHARow = New TableRow
JHATextCell = New TableCell
JHAEmptyCell = New TableCell
JHAImageCell = New TableCell
JHARow.Cells.Add(JHATextCell)
JHARow.Cells.Add(JHAEmptyCell)
JHARow.Cells.Add(JHAImageCell)
JHATable.Rows.Add(JHARow)
Controls.Add(JHATable)
JHATextCell.Controls.Add(JHATextBox)
JHAImageCell.Text = "<a href=""java script:LookupDate(Form1, " & JHATextBox.UniqueID & ", document.forms[0]." & JHATextBox.UniqueID & ".value)""><img alt=""Show Calendar"" src=""/Common/images/btn_calendar.gif"" border=""0"">"
End Sub
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
May 7th, 2004, 07:53 AM
#3
-
May 7th, 2004, 09:44 AM
#4
I wonder how many charact
I posted a thread in here that I want people to look at our web app, use the supplied login, click event/shift logs, and you will be able to see the usability of our control..
You can press space on an empty field and it will fill in the current date...etc
-
May 7th, 2004, 09:44 AM
#5
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|