locked
String Parameters RRS feed

  • Question

  • User-797751191 posted

    Hi

      How to pass 2 parameter string in below code

    <a id="lnkReject" runat="server" class="btn btn-danger btn-xs" onclick='<%# Eval("Document No_","editPop({0})") %>'><i class="fa fa-ban"></i></a>

    I am getting below error - SIESL is not defined

    <a id="lnkReject"  onclick="editPop(SIES)>

    Thanks

    Monday, July 8, 2019 3:59 PM

Answers

  • User475983607 posted

    You are missing quotes around 'SIES' or you are missing a SIES variable.

    <%# Eval("Document No_","editPop('{0}')") %>'>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 8, 2019 5:24 PM

All replies

  • User475983607 posted

    You are missing quotes around 'SIES' or you are missing a SIES variable.

    <%# Eval("Document No_","editPop('{0}')") %>'>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 8, 2019 5:24 PM
  • User-797751191 posted

    Hi

      Thanks . If i want to pass one more string variable then how it should be written

    Thanks

    Monday, July 8, 2019 5:33 PM
  • User475983607 posted

    jsshivalik

      Thanks . If i want to pass one more string variable then how it should be written

    Use proper JavaScript syntax!   You really need to spend some time learning the language and the debugging tools available to you.  Most of your question are related to syntax which is openly published.

    The JavaScript syntax for passing more than one string argument is...

    editPop('arg1', 'arg2', 'arg3');

    You are building JavaScript using string concatenation in C# on a bound control.  So make sure the results are valid JavaScript syntax.

    Monday, July 8, 2019 5:45 PM