0

I have button, which should open a modal pop up with iFrame to a page.

Currently the button click opens a PostBackUrl, I want a similar thing to happen here.

That is, I want to open the Iframe scr Page as postbackurl.

<asp:Button ID="btnCreateComp" runat="server" Text="Create Company" CssClass="button_style"
            PostBackUrl="~/Company.aspx" />

<asp:Panel ID="Pnl1" runat="server" CssClass="PanelPopup">
    <div>
        <iframe id="iframe1"  runat="server" height="500px" width="500px" src="" ></iframe>
        <asp:Button ID="btnclose" runat="server" Text="Close" CausesValidation="false"  />
    </div>
</asp:Panel>
spajce
  • 7,044
  • 5
  • 29
  • 44
shradha
  • 147
  • 2
  • 16

1 Answers1

0

I think you should use jquery pop up because it is easier than modalpopupextender because I found it buggy some time there are a lot of pop up in jquery:
Jquery popup exmaples

I used this one and it is working perfectly (you can place what ever you want) for me:

Note:The best feature I like about Jquery it is not required that your control must have runat="server" it works with both HTML Controls and ASP.NET Controls.

Adding event handler to button:

 <asp:Button ID="btnclose" runat="server" Text="Close" CausesValidation="false" onclick="btnClicked" />

In the code behind:

protected void btnClicked(object sender, EventArgs e)
{
iframe1.src="an http link";
//do not try set src to www.google.com because they are blocking Iframe
}
BMW
  • 590
  • 1
  • 6
  • 12
  • no i dont want to use jquery. can i somehow do it with the same procedure? can anyone please help? – shradha Feb 23 '13 at 07:37
  • If you want to set value for src you must add event handler to your button and then set the value for th Iframe – BMW Feb 23 '13 at 11:22