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.
Who is Participating?
masterpassConnect With a Mentor Commented:
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
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.