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 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Aug 21, 2013, 6:17 AM
You can't access not-static (iframe) inside static method.
Regards,
Iftikar
ashok kumarPosted Aug 21, 2013, 6:45 AM