I have written an jquery code to call my webmethod, webmethod is invoking no issue in that, in that webmethod iam not able to add the iframe elements attributes.Iam getting object refrence not set to an instance at run time.pls help me out. in adding the iframe attributes.
aspx code:
cs:
[WebMethod]
public static void loadavailablecabs(string PickupLat, string PickUpLon)
{
BookingPage p = new BookingPage();
p.IframeZoneBased.Attributes.Add("src", "../MasterPage/MiniListPage.aspx?CompanyID=" + "2" + "&LocationId=" + " 1" + "&EmployeeId=" + "2" + "&RoleId=" + "3" + "&LoginID=" + "3");//not working
p.loadtest();
//
}
public void loadtest()
{
IframeCabavailable.Attributes.Add("src", "../MasterPage/MiniListPage.aspx?CompanyID=" + strCompanyid + "&LocationId=" + strGelocationid + "&EmployeeId=" + "0" + "&RoleId=" + strRoleid + "&LoginID=" + strLoginid);//not working
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Iftikar HussainRank #423 · 5.9K reputationPosted Aug 21, 2013, 2:17 AM EDT
You can't access not-static (iframe) inside static method.
Regards,
Iftikar
ashok kumar69 reputationPosted Aug 21, 2013, 2:45 AM EDT