Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

 


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

Posted
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...