Different DataList fields on PageLoad (Repost)

  • Thread starter Thread starter Stephan Bour
  • Start date Start date
S

Stephan Bour

I repost this since I know how much some list people hate html posts ;-)

Hi,
I have a query page were users can check previous orders according to a
number of parameters. The query results are presented in a datalist and the
datasource is a sql query.
Since I capture the user name at logon, I thought I¹d provide a default
datalist with all the orders for that particular user at pageload. In that
case, I don't need to display the name information for the user in the
datalist. However, I need to keep the Name field in the datalist to
accommodate subsequent queries by the user. How do I make the Name column of
the datalist invisible at pageload if the page is not postback?
Thanks for your help,
Stephan.
 
I think you would just have <asp:BoundColumn visible="false" ... >
and then in Page_Load,
If Page.IsPostBack Then
' set the column's visibility to true

Justin
 
Back
Top