DataBinding Method Such as Eval(),XPath(), and Bind() can Only be used in the Context of a databound Control.

 
Problem: - DataBinding Method Such as Eval(),XPath(), and Bind() can Only be used in the Context of a databound Control.

Solution :-   Use  DataBinder.Eval(Container.DataItem,"field_name")  Method

                    Instead of  Eval(“field_name”)

Description :- 

This Error Mainly Cause Because Of using Eval(“field_name”) Method to bind Control in Grid view.  Instead of Eval Method if we use DataBinder.Eval(Container.DataItem,"field_name") the Error Got Solved. I am Using Grid view from Last 2 Years but never got this Error before. But One Day When I use Nested Grid view this Error throw by .Net Compiler. If there is Only One grid view then Eval method is ok. Please if you have any extra Information Comment On this. In Comment Please Write How’s u got this Error and Solution you have done for this.


Thank you.

Posted in |

13 comments:

  1. Anonymous Says:

    thanks a lot... Saved my live!!!

  2. Amir Sayani Says:

    Thanks, Great it saved time

  3. Anonymous Says:

    Thank you, you have right. It really works. Thank you again

  4. Adrián Says:

    Great. I typed exactly DataBinder.Eval(Container.DataItem,"my_field_here") and the "Los métodos de enlace de datos como Eval(), XPath() y Bind()..." problem disappeared.
    (In Spanish, yes)

  5. Afqam Says:

    I was finding way to insert data into access using eval((“field_name") in last 3 days, and i have searched a lot of pages but nothing, after reading this page, my problem is solved.
    Thanks a lot for sharing this greate iformation

  6. Khaled El Sheikh Says:

    Thanks A lot good Job :)

  7. parag Says:

    thanks u save lots time its now working fine on repeater

  8. Anonymous Says:

    Thank you so much..It made my life much easier..

  9. sheen Says:

    well , this solved the problem but i got it when i was using tostring and convert method in eval.
    still not able 2 find cause of eror

  10. Kevin Says:

    Thank you very much!
    This works perfect!

  11. Mani Maran Says:

    i changed but error is not yet cleared...give alternate solution for this.....

  12. baj Says:

    Thanks!

  13. أشرف صبري Says:

    Thank you for sharing this. I've never known the solution for this nasty problem before.

Post a Comment