If you have that property visible when the html renders (see if it does by viewing source on your browser), then you would be able to fetch it on the client end using JS.
You could reference the report viewer control either by assigning it a unique class name, or by using jQuery's ends with or contains selector:
$("[id*='ReportViewer1']").attr("attributeName");
- this is the contains selector
http://api.jquery.com/attribute-contains-selector/
http://api.jquery.com/attribute-ends-with-selector/
Is this what you are looking for?
UPDATE on the HTML5 data attribute question:
Just a cleaner way to store arbitrary data in the html (for more convenient access to Javascript). Here is a good article that explains it here
So, what you would do in practice is this: Imagine you want to add the report viewer's parameter (which for the sake of argument has a value of "42") as an attribute to a Panel control you have with an ID="Panel1"
. In code behind you would do
Panel1.Attributes.Add("data-report-param", "42");
.
Because the Panel control is rendered as a <div>
element, you will see something like this:
<div id="Panel1" data-report-param="42">
Finally you would be able to grab it from Javascript using one of the following two ways:
$("#Panel1").data("report-param");
$("#Panel1").attr("data-report-param");
UPDATE on retrieving the attribute
If they are on the same node, try this:
$.each($("[id*='ReportViewer1']"), function(index, value) {
if ($(value).is("[data-report-param]"))
{
alert($(value).attr("data-report-param"));
}
});
This will go through each element that contains "ReportViewer1" in its ID. Then for each item it will check if that element contains the "data-report-param" attribute. If so, alert the value. Hope this finally helps :)