Subject: formview please urgent help
Posted By: jameee Post Date: 9/9/2006 6:16:43 AM
i have a formview with the edit, delete and new buttons. i want to make the property of lifeupload to be visible when the user click the edit or insert button???? how to make that as i wrote the following code but it did not work for me:


Protected Sub FormView1_ItemCommand(ByVal sender As Object, ByVal e As FormViewCommandEventArgs)

        If (e.CommandName.Equals("Edit")) Then
            'Page.Button1.Visible = True
            CType(Page.FindControl("Button1"), Button).Visible = True

        ElseIf (e.CommandName.Equals("New")) Then
            Button1.Visible = True
        
         End If

    End Sub

regards

Reply By: Mujeeb Mehdi Reply Date: 9/12/2006 10:13:49 AM
try the following step with in the ItemCommand method

'Declare object for the controls you have
    
Dim but1 as Button

'.....rest of button declaration

  If e.CommandName = "Edit" Then
            but1=CType(Page.FindControl("Button1"),Button)
            but1.visible=True
elseif e.CommandName="New" then
         '  ...Other button declaration as per your need...
      end if


Reply By: jameee Reply Date: 9/15/2006 5:18:42 PM
thank you very much
regards


Go to topic 46518

Return to index page 173
Return to index page 172
Return to index page 171
Return to index page 170
Return to index page 169
Return to index page 168
Return to index page 167
Return to index page 166
Return to index page 165
Return to index page 164