I have a static method where I want to get the "div" inner html I Used the following method
[WebMethod]
public static string SetFileNameU(List<string> someValues)
{
string linkmain = link.Replace("Journey=R", "Journey="+journey);
SearcResult src = new SearcResult();
src.iframesourceType(linkmain);
return linkmain;
}
and here i called non static function passing link to that fucntion
public void iframesourceType(string linksrc)
{
frame.InnerHtml = ""; //// error frame is null
}
and returns the error
object refrence not set to initialization of object
my html frame is div
<div runat="server" id= "frame" class="col-md-9">
<%--<iframe class="ifr" >
</iframe>--%>
</div>
kindly tell me how to change content my webform class is searchresult.cs and frame.innerHtml was working at form laod and can be aceesed but calling from static after ajax call in non static function it works
why static?
1-first time when i open file i use that
protected void Page_Load(object sender, EventArgs e)
{
string link = Convert.ToString(Session["url"]);
Label1.Text = link;
SomewhereInTheCode();
frame.InnerHtml = (" <iframe class='ifr' frameborder='0' src='" + link + "' > </iframe>");
}
now i am using ajax call to web method to change inner HTML as needed see the code at top and it work only at page load
div is runat server so acesed from server side as frame
error frame is null- Guy