Hiding a grid view?

R

Rob Meade

Hi all,

I have a simpler web form where I enable the user to perform a search
against our Index Server.

I am using ASP.Net 2.0 and AJAX.

When the user clicks the button the search is performed a GridView is
populated with data and is displayed to the user on the screen.

I also have a little "progress" indicator which animates whilst it is
searching. When the user performs a new search and clicks the button again
I want the gridview to disappear, but currently it isn't and I cant work out
why not.

The button is causing an async post back, so I guess thats why it doesn't
completely disappear, but I would have thought by adding grdResults.Visible
= False and upnResults.Update() would have been sufficient, but it simply
doesn't ever disappear.

The GridView is populated with new data if the search is new, if the search
is a search word that was used within the last 5 minutes then the GridView
is populated from the cache.

I have found that if I set the upnResults.Visible = False and then
upnResults.Update() it does disappear, but I have to turn the visibility
back on for the new search results to be displayed and then the GridView
appears momentarily with the old data in it...

Can anyone help me out - its driving me crazy - its only a cosmetic thingy
really for the users benefit but it would look so much better!

Regards

Rob
 
B

bruce barker

remember a postback just get new html to render. setting the visibility
on the server while processing has no impact on the currently render html.

you need to hide the grid with javascript at the same time you start the
animation. i'd replace the grid with a loading animation.

-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top