locked
Uncaught Syntax error Unexpected Token RRS feed

  • Question

  • User-797751191 posted

    Hi

      In editPop i am getting error . If no parameter is passed then it works

      <a id="lnkReject" runat="server" class="btn btn-danger btn-xs" onclick='editPop(<%#Eval("E No")%>)'></a>

    Thanks

    Monday, July 1, 2019 6:53 AM

Answers

  • User665608656 posted

    Hi jsshivalik,

    According to your description, the reason for this error is that the format of the parameter you brought in is incorrect.

    There are several ways you can replace your present writing, you could refer to the following code:

     <a id="lnkReject" runat="server" class="btn btn-danger btn-xs" onclick='<%# "editPop(" +Eval("E No") + " );" %>'>click</a>

    Or:

     <a id="lnkReject" runat="server" class="btn btn-danger btn-xs" onclick='<%# string.Format("editPop(\"{0}\");", Eval("E No")) %>'>click</a>

    Best Regards,

    YongQing.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 1, 2019 8:03 AM