Show Gridview ONLY on Postback

L

Larry Bud

What's the best way to only show a gridview on a postback? The reason
is that I have a simple search page with a couple of fields, and I
want those fields to be chosen before displaying every row of data.
The Gridview is displayed on the same page as the search fields.

I realize I can wrap the Gridview in a

<%if isPostback() then%>
....

<%end if%>

But as I transition from asp to asp.net, seems like putting code
inline is a thing of the past.

What's the best practice for this? Anyone have a good website that
shows some asp.net best practices>
 
M

Michael Nemtsev

Hello Larry,

Could you demonstrate the code which u got after converting?

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

LB> What's the best way to only show a gridview on a postback? The
LB> reason is that I have a simple search page with a couple of fields,
LB> and I want those fields to be chosen before displaying every row of
LB> data. The Gridview is displayed on the same page as the search
LB> fields.
LB>
LB> I realize I can wrap the Gridview in a
LB>
LB> <%if isPostback() then%>
LB> ...
LB> <%end if%>
LB>
LB> But as I transition from asp to asp.net, seems like putting code
LB> inline is a thing of the past.
LB>
LB> What's the best practice for this? Anyone have a good website that
LB> shows some asp.net best practices>
LB>
 

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

Top