How to enchance the control from scripts to get from the formview control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prasanna111
    New Member
    • Apr 2010
    • 5

    How to enchance the control from scripts to get from the formview control

    Iam using the formview control where while calling an control from the formview by means of script it gives an error mesg .

    by typing the script inside the control it works outside showing error
    how can i call it

    so i use an FindControl methods its shows an error

    Dim oCtrl As TextBox = Me.FormView8.Fi ndControl("txtE ventDate");
    Dim Test As String = oCtrl.Text;
  • semomaniz
    Recognized Expert New Member
    • Oct 2007
    • 210

    #2
    What error are you getting ?

    Comment

    • prasanna111
      New Member
      • Apr 2010
      • 5

      #3
      Originally posted by semomaniz
      What error are you getting ?
      The name 'txtEventDate' does not exist in the current context

      Comment

      • prasanna111
        New Member
        • Apr 2010
        • 5

        #4
        I already having that textbox control in the formview control

        But will calling from outside formview control through the script shoeing the error

        cannot call the base class from the outside class how to do it

        Help me ..\
        Thanks in advance

        Comment

        • semomaniz
          Recognized Expert New Member
          • Oct 2007
          • 210

          #5
          Can you post your entire code

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Usually when you see this error it's because that control is not available at that time.

            For instance say you have specified that the TextBox is to be shown while the user is editing....

            The user is not editing, and clicks a button....in the button click event you try to access the TextBox.

            But there is no TextBox to access because the user isn't editing!

            See what I'm getting at?

            -Frinny

            Comment

            Working...