Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Tuesday, April 7, 2009

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.

13 comments:

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

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

    ReplyDelete
  3. 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)

    ReplyDelete
  4. 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

    ReplyDelete
  5. Thanks A lot good Job :)

    ReplyDelete
  6. thanks u save lots time its now working fine on repeater

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

    ReplyDelete
  8. 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

    ReplyDelete
  9. Thank you very much!
    This works perfect!

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

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

    ReplyDelete