JavaScript how to pass returned value from JavaScript function as asp-route value? pass return value to callback javascript,pass return value another

I need to do something like below-

function GetParentID() {
    var tv = $('#treeview').data('kendoTreeView'),
    selected = tv.select(),
    item = tv.dataItem(selected);
    var Value= (item.ID);
    return Value;
}

Then i want to use the returned value like this-

<a asp-area="Marketing" asp-controller="Store" asp-action="Create" asp-route-ID="GetParentID()"  class="btn btn-default">Create</a>

I have try to save the value in hidden input like this:

<input id="p_ID" type="hidden" />

then fill this input throw jQuery and it's work like this :

$('#p_ID').val(GetParentID());

but still can't pass this value as asp-route-ID how i can achieve something like that ?

Answer:1

I've been trying to build a simple html form that highlights text in yellow on a page by wrapping it in a span on keyup of the form (using jquery). It works fine until I backspace on the keyboard to ...

I've been trying to build a simple html form that highlights text in yellow on a page by wrapping it in a span on keyup of the form (using jquery). It works fine until I backspace on the keyboard to ...

  1. does google index dynamic javascript content

I am trying to implement a graphQL API, it went well with queries but it's going not that well with mutations: Here is my basic mutation using apollo-client and graphql-tag: import gql from '...

I am trying to implement a graphQL API, it went well with queries but it's going not that well with mutations: Here is my basic mutation using apollo-client and graphql-tag: import gql from '...

  1. graphql syntax error expected name found
  2. graphql syntax error expected name found eof
  3. graphql syntax error unexpected eof
  4. graphql syntax error unterminated string
  5. graphql syntax error unexpected name
  6. graphql syntax error expected $
  7. graphql syntax error expected name
  8. graphql syntax error expected found
  9. graphql syntax error expected name found int
  10. graphql syntax error
  11. graphql message syntax error unexpected eof
  12. magento graphql syntax error unexpected eof
  13. syntax error graphql request expected name
  14. syntax error graphql request

I'm trying to find a way to take a link from one browser and open it in another browser. This could be taking a link from a Firefox tab and opening it in Chrome, or taking a link in a Chrome Incognito ...

I'm trying to find a way to take a link from one browser and open it in another browser. This could be taking a link from a Firefox tab and opening it in Chrome, or taking a link in a Chrome Incognito ...

I am trying to create a secure way for users to log in to and perform certain authorized actions on my custom website. I am trying to have good security without the use of SSL. At login now, this is ...

I am trying to create a secure way for users to log in to and perform certain authorized actions on my custom website. I am trying to have good security without the use of SSL. At login now, this is ...