C#/.Net 4.0, VS2013:
I have 3 tab controls (li elements linked to tabpanel in div tags) in an aspx page. Each tab contains a ReportViewer control, code snippet below. I'm passing the tab id through PageMethods, code snippet below.
$("li[role='presentation']").on("click", function () {
var liElement = $(this).attr("id");
PageMethods.TabChanged(liElement, OnSuccess, OnFailure);
}));Getting the selected tabid; based on this tabid, the respective report (reportviewer control embedded in the div tab-panel), has to be populated in the tab. But since the WebMethod is a static method, I have to convert all other methods the WebMethod calls, to static method. Instead, I created a Singleton instance of this class and calling populate report methods. But the problem is, when the tab is selected, the LocalReport object of the report viewer object throws NullReference exception. I'm sure its not getting the appropriate object instance to which the report viewer's LocalReport was assigned to.
Question:
1.How to solve this ?
2. Other than WebMethod and Ajax POST method (both works the same), is there any other way to know which tab is clicked at the code behind.
3. Tried onserverclick on both 'ul' and 'li' tags, that didnt recognize .
Tech Bang