How to bind GridView in WebMethod

Hi, Is it possible to bind GridView in a static WebMethod? I saw many suggestions on the Internet on how to do that but I did not see any source code, Any one have a source code to do that?

Please help.
LVL 3
Abdu_AllahAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
I think you can only if you pass the GridView object instance as an argument of the static method.

As a static method you can't access any specific objects unless you have them passed as an argument or have them declared as static. In the case of a web object like a GridView it doesn't makes sense to have it declared as static I don't think it would even work.

cheers!
0
masterpassCommented:
I would say It is NOT possible. As a work around you can create a HTML content in the web method and inject the HTML into the page

http://forums.asp.net/p/1494919/3526291.aspx

http://forums.asp.net/t/1422932.aspx

http://stackoverflow.com/questions/183310/how-do-i-update-a-gridview-from-a-page-method-from-code-behind
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.