I have a multiview on my aspx page whose ActiveViewIndex I want to set using javascript. for this I have used UpdatePanel inside which the MultiView control is placed. I have enabled the EnablePageMethods="True" of the ScriptManager.
Whenever I am calling the Server Method I am getting "Object reference not set to an Instance of an Object"
function CallScreens(id)
{
//var id,var type
//Call server side function
alert('Hello');
PageMethods.SetScreens("-1","screen",OnCallSumComplete,OnCallSumError,"");
}
The Server Side code is as given below
[System.Web.Services.WebMethod]
public static void SetScreens(string id,string Type)
{
try
{
TreeView obj = new TreeView();//Name of my Class
obj.MultiView1.ActiveViewIndex=1;
}
catch (Exception ex)
{
throw ex;
}
}