youtube links

2 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 18 Dec 2010 Link to this post

    I have a grid with 2 text boxes, 1 for a youtube link, the other for its description.  When I paste the link into the textbox and click the save button, I get a javascript error and the page crashes.  Heres the grid code

    <telerik:GridTemplateColumn UniqueName="YouTubeLink" HeaderText="YouTube Link"  SortExpression="YouTubeLink">
                                                        <%#DataBinder.Eval(Container.DataItem, "YouTubeLink")%>
                                                        <telerik:RadTextBox ID="RadTextBoxLink" Runat="server" Skin="Vista" Width="400px" MaxLength="2000" TextMode="MultiLine" Rows="10">
     and this is the link im trying to save

    <object width="480" height="385"><param name="movie" value=";hl=en_GB"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src=";hl=en_GB" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

    Im basically setting up a data entry screen where users can save various youtube links for subsequent display on their website, surely this is possible ?  Can anyone help me out ?
  2. Daniel
    Daniel avatar
    4949 posts

    Posted 23 Dec 2010 Link to this post


    This is a general error (not directly related to our controls) that is caused by the fact that you are trying to save HTML code in the DB. You have two options:

    1) Disable the request validation (not recommended)
    <%@ Page Language="C#" ValidateRequest="false" %>

    2) Manually encode the HTML code:

    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top