Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Nickel Contributor
Posts: 46
Registered: ‎08-17-2009
Accepted Solution

Display an iFrame in a web form

I need to display an iFrame in a tab on the Contact form.  I also need to pass some parameters to the iFrame.  Has anyone tried this before?

Highlighted
Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Display an iFrame in a web form

[ Edited ]

Here is a simple way to do it (but there are probably a few more out there):

 

I add a Control Container to my form, and lay it out as desired. I called it something related (e.g. ccIFrame).

 

I then add a Load Action to the Form and use the Following Code:

 

//From Load Action  -- This one is a C# snippet action

  string id = con.Id.ToString();


  LiteralControl lc = new LiteralControl();

  string URL = "http://www.mysite.com/getMoreInfo.ashx?contactid=" + id;
  string str = "<iframe id='myIFrame' name='picFrame' height='200' width='200' scrolling='no' frameborder='0'";
  str += "seamless='seamless' src='" + URL + "'></iframe>";
  lc.Text = str;


  ccPicture.Controls.Clear();
  ccPicture.Controls.Add(lc);

 

Also, I make sure to set the On Entity Changing and On Repaint Event properties of the Action to True

Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com
Highlighted
Nickel Contributor
Posts: 46
Registered: ‎08-17-2009

Re: Display an iFrame in a web form

Thanks a lot Raul. I'll give it a shot in the morning!