fnServerParams question

fnServerParams question

jchappell99jchappell99 Posts: 15Questions: 0Answers: 0
edited January 2014 in General
I am passing a value from an inputbox in ASP.NET to a web service. Below is the code to pass the value:

aoData.push({ "name": "sFilter1", "value": $('#PName').val() });

Here is the textbox from the web page:



The value in the web service is "" but when I hard code a value, the value appears in the web service.

The #PName text box is inside a content area as I am using MasterPages in ASP.NET. Is there a trick to access form values when using Master Pages and content areas?

Replies

  • jchappell99jchappell99 Posts: 15Questions: 0Answers: 0
    Update:

    If I move the textbox declaration into the Master Page .aspx file, it recognizes the #PName and passes the value to the web service correctly...

    So, my question is how to I access #PName via JS if it's on a child page of the master page inside of an ASP:Content control?

    John
  • jchappell99jchappell99 Posts: 15Questions: 0Answers: 0
    Resolved:

    In .NET 4 and up, the control name is changed to some crazy name when the HTML is rendered. This is for .NET controls only. You can put this directive in the page declaration or web.config to get the ID to render with the actual value assigned:

    ClientIDMode="Static"

    After adding this, the value is getting passed with the above code.. all is well.

    This can be closed.

    John
This discussion has been closed.