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

Discussion in 'ASP .Net' started by jobs, Nov 7, 2006.

  1. jobs

    jobs Guest

    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
     
    jobs, Nov 7, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roger Lord

    Equating a String & Integer Variable

    Roger Lord, Jul 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    391
    Roger Lord
    Jul 3, 2003
  2. Zarn Bou via DotNetMonster.com

    FindControl in FormView

    Zarn Bou via DotNetMonster.com, Mar 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    2,901
    Zarn Bou via DotNetMonster.com
    Mar 16, 2005
  3. Paul Aspinall

    FormView - FindControl

    Paul Aspinall, Feb 25, 2006, in forum: ASP .Net
    Replies:
    14
    Views:
    38,674
  4. sck10
    Replies:
    2
    Views:
    5,052
    sck10
    Aug 28, 2006
  5. Mr. SweatyFinger

    findcontrol in a formview

    Mr. SweatyFinger, Dec 1, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    444
    Mr. SweatyFinger
    Dec 1, 2006
Loading...

Share This Page