r>: Etiket ID= " Label1“ runat= Inherente Datum van " server“ Text= de ": „> | d>tBox ID= " txtIncidentDate“ runat= " server“ Text='<%# bindt („IncidentDate“,“ {0: D} „) %>'>>age ID= de " Image10“ runat= " server“ ImageUrl= " Calendar_scheduleHS.png“/>
ntDate“ Enabled= " Ware " >
d>
>Label ID= " Label3“ runat= Niveau van de Veiligheid van " server“ Text= het ": „> | <td>
DataSourceID= " SqlDataSource6“ DataTextField= " SecurityLevel“
DataValueField= " SecurityLevel“ SelectedValue='<%# van " ddlSecurity“ van DropDownList ID= runat= " bindt („SecurityLevel“) %>'>d>
>Label ID= " Label2“ runat= " server“ Text= " Faciliteit waar Voorgekomen " > | > DataSourceID= " SqlDataSource1“ DataTextField= " FacilityDescriptions " DataValueField= " FacilityDescriptions“ SelectedValue='<%# van " ddlFacility“ van DropDownList ID= runat= " bindt („FacilityWhereOccured“) %>'>d> |
>Label ID= " Label4“ runat= " server“ Text= " Classificatie van Recent Vooruitlopend Gedrag " > | > e7“ DataTextField= " RiskRating " DataValueField= " RiskRating“ > | </tr>d>el ID= de " Label5“ runat= " server“ Text= " Programma waar Voorgekomen " >> DataSourceID= " SqlDataSource2“ DataTextField= " ProgramDescription“ DataValueField= " ProgramDescription“ SelectedValue='<%# bindt („ProgramWhereOccurred“) %>'>d> |
>Label ID= " Label6“ runat= Categorie van " server“ Text= de " van Incident: „>d> | DataSourceID= " SqlDataSource8“ DataTextField= " SeriousIncident“ DataValueField= " SeriousIncident“ SelectedValue='<%# bindt („CategoryOfIncident“) %>'>d> |
>Label ID= " Label7“ runat= " server“ Text= Gebied " > | | >
DataSourceID= " SqlDataSource5“ DataTextField= " WardDescriptions“
DataValueField= " WardDescriptions“ SelectedValue='<%# van " ddlArea“ van DropDownList ID= runat= " bindt („ResidenceArea“) %>'>d>
>entTemplate><tr valign=top> | d>tBox ID= " txtYear“ runat= " server“ Text='<%# bindt („IncidentYear“) %>'>r>bel> | <td>xtBox ID= de " txtNarrative1“ runat= " server“ TextMode=MultiLine Width=500px Height=195px MaxLength=1073741823 Text='<%# bindt („Verhaal“) %>'>r> emplate>cc1: TabPanel>abContainer>ton ID= " btnUpdate“ runat= " server“ Text= " Update“ CommandName= " Update“/> rtItemTemplate>TabContainer ID= " TabContainer1“ runat= " server“ Height= " 350px“ Width= " 700px“ ActiveTabIndex= " 0“ > Main r>: Etiket ID= " Label1i“ runat= Inherente Datum van " server“ Text= de ": „> | d>tBox ID= " txtIncidentDatei“ runat= " server“ Text='<%# bindt („IncidentDate“,“ {0: D} „) %>'>ge ID= de " Image10i“ runat= " server“ ImageUrl= " Calendar_scheduleHS.png“/> ntDatei“ Enabled= " Ware " > d> >Label ID= " Label3i“ runat= Niveau van de Veiligheid van " server“ Text= het ": „> | <td> DataSourceID= " SqlDataSource6“ DataTextField= " SecurityLevel“ DataValueField= " SecurityLevel“ SelectedValue='<%# van " ddlSecurityi“ van DropDownList ID= runat= " bindt („SecurityLevel“) %>'>d> >Label ID= " Label2i“ runat= " server“ Text= " Faciliteit waar Voorgekomen " > | > DataSourceID= " SqlDataSource1“ DataTextField= " FacilityDescriptions " DataValueField= " FacilityDescriptions“ SelectedValue='<%# van " ddlFacilityi“ van DropDownList ID= runat= " bindt („FacilityWhereOccured“) %>'>d> | >Label ID= " Label4i“ runat= " server“ Text= " Classificatie van Recent Vooruitlopend Gedrag " > | > e7“ DataTextField= " RiskRating " DataValueField= " RiskRating“ > | </tr>d>el ID= de " Label5i“ runat= " server“ Text= " Programma waar Voorgekomen " >> DataSourceID= " SqlDataSource2“ DataTextField= " ProgramDescription“ DataValueField= " ProgramDescription“ SelectedValue='<%# van " ddlProgrami“ van DropDownList ID= runat= " bindt („ProgramWhereOccurred“) %>'>d> | >Label ID= " Label6i“ runat= Categorie van " server“ Text= de " van Incident: „>d> | DataSourceID= " SqlDataSource8“ DataTextField= " SeriousIncident“ DataValueField= " SeriousIncident“ SelectedValue='<%# van " ddlCategoryi“ van DropDownList ID= runat= " bindt („CategoryOfIncident“) %>'>d> | >Label ID= " Label7i“ runat= " server“ Text= Gebied " > | | > DataSourceID= " SqlDataSource5“ DataTextField= " WardDescriptions“ DataValueField= " WardDescriptions“ SelectedValue='<%# van " ddlAreai“ van DropDownList ID= runat= " bindt („ResidenceArea“) %>'>d> > | entTemplate>bPanel> entTemplate><tr valign=top> | d>tBox ID= " txtYeari“ runat= " server“ Text='<%# bindt („IncidentYear“) %>'>r>bel> | <td>xtBox ID= de " txtNarrative1i“ runat= " server“ TextMode=MultiLine Width=500px Height=195px MaxLength=1073741823 Text='<%# bindt („Verhaal“) %>'>r> emplate>cc1: TabPanel>abContainer>ton ID= " btnInsert“ runat= " server“ Text= " Tussenvoegsel“ CommandName= " Tussenvoegsel“/>
|
|
Antwoord : Formview - Uitzondering System.NullReference wanneer het gebruiken van findcontrol
|
Hallo,
De controles zijn waarschijnlijk geen directe childcontrols aan formview. Probeer dit
txtIncidentDatei van TextBox = FindControlRecursive (FormView1, „txtIncidentDatei“) als TextBox;
. . . openbare statische Controle FindControlRecursive (de wortel van de Controle, koordidentiteitskaart) { als ((root.ID! = verklaar) && (identiteitskaart root.ID ==) nietig) keer wortel terug;
foreach (Controle CTRL in wortel. Controle) { Gevonden controle = FindControlRecursive (CTRL, identiteitskaart); als (gevonden! = ongeldige) gevonden terugkeer; }
ongeldige terugkeer; }
/peter
|
|
|