I have a ASP page that have an iframe and a canvas. The iframe loads a given url, when i navigate through a website in the iframe and perfrom any other function on my ASP page, the APS page gets loaded which results in the iframe to go back to the given URL. Is it possible to hold the session of the iframe using AJAX
? If yes,please help me!
P.S : its a basic ASP application.
<div class="row">
<div class="col-sm-8">
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Always" runat="server">
<ContentTemplate>
<iframe id="urlIframe" runat="server" width="900" height="500" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="col-sm-4">
<div>
<asp:TextBox ID="Navigation_top_1" runat="server" Width="300" />
<br />
<br />
<div>
<label>
Drawing tool:
<select id="dtool">
<option value="rect">Rectangle</option>
<option value="pencil">Pencil</option>
</select>
</label>
<div id="container">
<canvas id="my_canvas_1" width="300" height="300" onclick="CLIPBOARD_CLASS('my_canvas_1',true);"></canvas>
</div>
</div>
<br />
<br />
<asp:TextBox ID="Navigation_bottom_1" runat="server" Width="300" />
</div>
</div>
</div>
And my code behind is :
public partial class Default2 : System.Web.UI.Page
{
static int i = 0;
static string URL = string.Empty;
public void Page_Load(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(URL))
{
URL = (string)Session["URL"];
urlIframe.Attributes.Add("src", URL);
}
}
}
Thanks!