Sadhana Khaire

Sadhana Khaire

  • 1.8k
  • 58
  • 4.5k

Iframe In Update Panel is Not Working

Oct 31 2017 2:52 AM
I have repeater control and iframe in same update panel.
In repeater control, Link buttons are placed. On Click event of that link button, I want to update my Iframe. I am updating Iframe By javascript code.
But The code is not working.
 
Here is the designer Code:
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>

<div style="display: inline-block; border: solid 0px red; vertical-align: top;">
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Button ID="LinkButton1" runat="server" class="btn btn-primary" Style="color: #fff; background-color: #337ab7; border-color: #2e6da4; display: inline-block; padding: 6px 8px; margin-bottom: 0; border: 1px solid transparent; border-radius: 4px;"
OnClick="LinkButton1_Click" Text='<%#Eval("Row#") %>' />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<asp:Label ID="lblfetchdata" runat="server"></asp:Label>
<asp:Label ID="lblfetch" runat="server"></asp:Label>
</div>
<div style="display: inline-block; border: solid 0px green; vertical-align: top;">
<iframe id="ifrm_RentPrint" style="width: 334%; height: 900px; border: 0; margin-top: -24px"></iframe>
</div>

</ContentTemplate>

</asp:UpdatePanel>
 
And Code Behind Is:
 
protected void LinkButton1_Click(object sender, EventArgs e)
{


FilterResult();
Button button = (Button)sender;
string buttonId = button.Text;
DataTable dt_OwnerFilter = new DataTable();


dt_OwnerFilter = bl.BL_FetchOwnerInfo(bo);


lblfetchdata.Text = string.Empty;
int i = 0;
foreach (DataRow dRow in dt_OwnerFilter.Rows)
{
butId = dt_OwnerFilter.Rows[i][0].ToString();
if (buttonId == butId)
{
if (dt_OwnerFilter.Rows.Count > 0)
{
string htmlcode = "";
htmlcode = "<a class='btn btn-primary' onclick='fnShow(" + dRow["PropertyDetailsId"] + ")'> " + i + "</a>";

ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:fnShow(" + dRow["PropertyDetailsId"] + "); ", true);

break;
}

}
else
{
i = i + 1;
}
}
if (dt_OwnerFilter.Rows.Count == 0)
{
lblfetch.Text = " Zero Results Found For Your Search...!!!.";
}

 
 

Answers (1)