Different DataList fields on PageLoad (Repost)

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.
 
J

Justin Dutoit

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top