Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2006, 06:16 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default formview please urgent help

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

 
Old September 12th, 2006, 10:13 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


 
Old September 15th, 2006, 05:18 PM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you very much
regards





Similar Threads
Thread Thread Starter Forum Replies Last Post
FormView Question mikener ASP.NET 2.0 Professional 9 September 24th, 2008 05:39 PM
formview mcarol44 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 January 5th, 2008 06:44 AM
FormView Control lokraj ASP.NET 2.0 Basics 0 September 11th, 2007 08:51 AM
How does Update Link in FormView work? URGENT shaly ASP.NET 2.0 Professional 0 December 7th, 2006 04:10 PM
Formview with ObjectDataSource rturner003 ASP.NET 2.0 Professional 3 November 1st, 2006 06:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.