Home All Groups Group Topic Archive Search About
Author
17 Feb 2006 8:10 AM
Alessandro
Scenario:

formview - 1) in the formview there are a <table> tag to control the layout.
                 2) there are many added controls in EditItemTemplate and
                     InsertItemTemplate

In the code behind (in a separate file) the code:

     For Each WebControl As System.Web.UI.Control In Me.formview.Controls
        If WebControl.ID = "ddlCodiciIVA" Then
          MsgBox("Hello")
        End If
      Next

don't work.

Note (I see in debug): Me.frmvwArticoli.Controls.Count = 1 ?

                                                             Thanks in
advance, Alessandro

Author
17 Feb 2006 2:59 PM
Phillip Williams
MsgBox is not a function in ASP.Net.  Review the FormView events page
http://msdn2.microsoft.com/en-us/library/56efack7.aspx to see several samples
on how to retrieve the controls within the FormViewRow as in this article on
the ItemCommand:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.itemcommand.aspx
Show quoteHide quote
"Alessandro" wrote:

> Scenario:
>
> formview - 1) in the formview there are a <table> tag to control the layout.
>                  2) there are many added controls in EditItemTemplate and
>                      InsertItemTemplate
>
> In the code behind (in a separate file) the code:
>
>      For Each WebControl As System.Web.UI.Control In Me.formview.Controls
>         If WebControl.ID = "ddlCodiciIVA" Then
>           MsgBox("Hello")
>         End If
>       Next
>
> don't work.
>
> Note (I see in debug): Me.frmvwArticoli.Controls.Count = 1 ?
>
>                                                              Thanks in
> advance, Alessandro
>