Equating one formview to another ?? Dynamic type code? Findcontrol?

J

jobs

In the below code, why can't I equate which form to a formview like we
do with controls under the main control. The below gives me an error
because whichform does not really take all the properties of the form
which I equate to it.

I know the below is not an issue when I use FindControl on a dropdown.
I tried Findcontrol, but that did not work.

Sub DatePicker(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim FormMode As String
Dim StartorEnd As String
Dim whichform As FormView
Dim FormTime As String
If sender.clientid().ToString.Contains("Rate") Then
whichform = RateFormView
Else
whichform = ChargeFormView
End If
If whichform.CurrentMode = FormViewMode.Edit Then
Formmode = "E"
Else
FormMode = "I"
End If
If sender.clientid().ToString.Contains("Start") Then
StartorEnd = "S"
FormTime = " 12:00:00 AM"
Else
StartorEnd = "E"
FormTime = " 11:59:59 PM"
End If

Dim PopUpCtrlExt As AjaxControlToolkit.PopupControlExtender =
whichform.FindControl(StartorEnd + "Popup")
Dim Cal1 As Calendar =
RateFormView.FindControl(whichform.ID.ToString.Substring(1, 1) +
FormMode + StartorEnd + "Calendar")
PopUpCtrlExt.Commit(Cal1.SelectedDate.ToShortDateString +
FormTime)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top