I have an asp:table inside an itemtemplate of a datalist (dlstForDetails)
the id in three rows of the table is, tblrMembers1, tblrServices1,
tblrBelongs1
Depending on the "go" value of the querystring I want to show or hide any of
these rows.
The code is the following but I get the error
Object Reference not set to an instance of an object
Dim tblrMembers, tblrServices, tblrBelongs As TableRow
tblrMembers = CType(dlstForDetails.FindControl("tblrMembers1"), TableRow)
tblrServices = CType(dlstForDetails.FindControl("tblrServices1"), TableRow)
tblrBelongs = CType(dlstForDetails.FindControl("tblrBelongs1"), TableRow)
Select Case Request.QueryString("go")
Case "YP"
tblrMembers.Visible = False
tblrServices.Visible = False
tblrBelongs.Visible = False
Case "EP"
tblrMembers.Visible = False
Case "AN"
tblrServices.Visible = False
tblrBelongs.Visible = False
Case "KE"
tblrMembers.Visible = False
tblrBelongs.Visible = False
End Selectthere are many possible causes.
the datalist will create a Header even if it does not show it. Check the
ItemType of the item before trying to hide anything as you table wont be in
the header
Yeap you're right thanks a lot!!!
"Josh" <s@.a.com> wrote in message
news:Ok6z3VjSFHA.3144@.TK2MSFTNGP09.phx.gbl...
> there are many possible causes.
> the datalist will create a Header even if it does not show it. Check the
> ItemType of the item before trying to hide anything as you table wont be
> in the header
>
Saturday, March 24, 2012
Object Reference Not Set To An Instance of an Object
Labels:
asp,
asptable,
datalist,
dlstfordetails,
inside,
instance,
itemtemplate,
net,
object,
reference,
rows,
table,
tblrmembers1
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment