Populate Iframe from Datagrid Container.DataItem

GregD

Newcomer
Joined
Jun 26, 2004
Messages
15
I have included an iframe in my datagrid and im trying to put <%# Container.DataItem("article").Trim()%> into the iframe like a wysiwyg editor.

The datagrid is in a usercontrol.

Ive tried:

Code:
iView.document.write('<%# Container.DataItem("article").Trim()%>')

iView.document.close()

In my aspx where iView is the ID of my iframe... but i just get 'DataItem' is not a member of 'System.Web.UI.Control'.

Ive tried putting the javascript in the user control but no luck there either.

Anyone been able to do this?

Thanks
 
Ive tried putting the javascript in the user control but no luck there either.
1) <%# Container.DataItem("article").Trim()%> is not javascript but vb.net code used for data binding.

2) You should try using <%# DataBinder.Eval(Container.DataItem, "article")%> instead of <%# Container.DataItem("article").Trim()%>.

Jeff B
 
Back
Top