This is a migrated thread and some comments may be shown as answers.

VS2010 - Can't Add Reference to Telerik.Web.UI

8 Answers 441 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 08 Sep 2010, 04:09 PM
I've read every article available, and have verified that all three .dll versions (2.0, 3.5, and 4.0) are located in the GAC.  However, Telerik.Web.UI is STILL not listed in the Add References list.  This only happened since I uninstalled the trial version and replaced it with the paid-for version.

I even tried adding a registry key, and that didn't help.

Am I missing something?

Kyle

8 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 09 Sep 2010, 01:17 PM
Hello Kyle,

Indeed with version 2010.2.826 of RadControls for ASP.NET AJAX we removed the Telerik AJAX assemblies from the Add References list due to the reasons explained in this forum post. Please consider navigating manually to the Telerik.Web.UI/Telerik.Web.Design dlls to add reference to them.

Kind regards,
Sebastian
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jerome
Top achievements
Rank 1
answered on 03 May 2012, 07:57 PM
That solution really makes it hard to work right. Visual Studio keeps correcting the HintPath to ..\..\..\..\..\..\Program Files, and stuff. Which is of course wrong for lots of people.

I cannot control where my users check out their source code. And I shouldn't have to.

Can you guys solve this in some other way?
0
Jerome
Top achievements
Rank 1
answered on 03 May 2012, 07:57 PM
That solution really makes it hard to work right. Visual Studio keeps correcting the HintPath to ..\..\..\..\..\..\Program Files, and stuff. Which is of course wrong for lots of people.

I cannot control where my users check out their source code. And I shouldn't have to.

Can you guys solve this in some other way?
0
Renato
Top achievements
Rank 1
answered on 23 Jul 2013, 08:15 AM
Hi Jerome, did you get any reasonable answer from Telerik? thanks
Hi Telerik, any solution please? thanks
0
Jerome
Top achievements
Rank 1
answered on 23 Jul 2013, 12:30 PM
No. I ended up building my own NuGet package for them. Telerik has their own NuGet package as well, but it too has issues.

The .nuspec file is really simple, if you know how to use it:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
    <metadata>
        <id>Telerik.Web.UI</id>
        <version>0.2013.1.417</version>
        <title>Telerik.Web.UI</title>
        <authors>Jerome Haltom</authors>
        <owners>Jerome Haltom</owners>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>Telerik.Web.UI</description>
        <releaseNotes />
        <copyright></copyright>
        <tags>telerik</tags>
    </metadata>
    <files>
        <file src="bin35\Telerik.Web.UI.dll" target="lib\net35" />
        <file src="bin35\Telerik.Web.UI.Skins.dll" target="lib\net35" />
        <file src="bin40\Telerik.Web.UI.dll" target="lib\net40" />
        <file src="bin40\Telerik.Web.UI.Skins.dll" target="lib\net40" />
        <file src="bin45\Telerik.Web.UI.dll" target="lib\net45" />
        <file src="bin45\Telerik.Web.UI.Skins.dll" target="lib\net45" />
    </files>
</package>

Obviously I just stuck my own info in it, and deployed it to to a local NuGet repository. Telerik needs to do some real work on this stuff. Like, oh, run their own NuGet repository for commercial customers. But before that, fix their own NuGet package. Or I really wouldn't even mind if they used .licx files and just published their DLLs in www.nuget.org, in demo mode until you set up a .licx file. Tons of perfectly acceptable options.
0
Dyanko
Telerik team
answered on 26 Jul 2013, 11:49 AM
Hello Jerome,

Would you please give us more details about the issue you are experiencing. It will be really helpful if you give us the exact steps to reproduce it.

We are looking forward to your response.

Regards,
Dyanko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Renato
Top achievements
Rank 1
answered on 26 Jul 2013, 11:55 AM
Well I have an issue where the RadEditor is recognized by the code behind of my User Control but the Content returns empty.

Here is my code:
<%@ Control Language="C#" Inherits="Expertime.PublishingComments.Library.Controls.Comments, Expertime.PublishingComments.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6b9c9c28502002f7" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2013.2.611.45, Culture=Neutral, PublicKeyToken=121fae78165ba3d4" %>
<%@Register TagPrefix="SharePointPortalControls" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
<style type="text/css">
    /* The following CSS needs to be copied to the page to produce textbox-like RadEditor */ .reWrapper_corner, .reWrapper_center {
        display: none !important;
    }
 
    .reLeftVerticalSide, .reRightVerticalSide, .reToolZone, .reToolCell {
        background: white !important;
    }
 
    .reContentCell {
        border-width: 0 !important;
    }
 
    .RadEditor {
        filter: chroma(color=c2dcf0);
    }
</style>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
    <script type="text/javascript">
        var currentLoadingPanel = null;
        var btSubmit = null;
        function RequestStart(sender, args) {
            currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID%>");
            btSubmit = "<%= panlcomments.ClientID %>";
            //show the loading panel over the updated control
            currentLoadingPanel.show(btSubmit);
 
        }
        function ResponseEnd() {
            //hide the loading panel and clean up the global variables
            currentLoadingPanel.hide(btSubmit);
            //clear
            btSubmit.SetHtml("");
            currentLoadingPanel = null;
            btSubmit = null;
 
 
        }
    </script>
</telerik:RadCodeBlock>
<div class="ftv-wp-title">
     <asp:Literal runat="server" ID="HeaderTitle"></asp:Literal>
        </div>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btSubmit">
            <UpdatedControls>
 
                <telerik:AjaxUpdatedControl ControlID="newCommentLiteral" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="panlcomments" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center" Skin="Vista">
</telerik:RadAjaxLoadingPanel>
 
 
 
<div class="ftv-content-social ftv-type2">
                                        <div class="ftv-comments">
                                            <a class="ftv-entry-comments" ><asp:Label runat="server" ID="NbCommentsLbl"/></a>
                                        </div>
                                        <div class="ftv-notes">
                                              <a>Note</a>
        <SharePointPortalControls:AverageRatingFieldControl ID="PageRatingControl" FieldName="AverageRating"    runat="server"/>
                                        </div>
</div>
<div class="Exp-Comments" id="ExpComments">
     <asp:Literal ID="existingComments" runat="server"></asp:Literal>
</div>
 
 
 
<asp:Literal ID="newCommentLiteral" runat="server"></asp:Literal>
<!-- on masque le control pour les anonymes -->
 
<asp:Panel ID="panlcomments" runat="server">
    <div class="exp-comment-message" style="display: none;">
        <asp:Label Visible="false" ID="lblMessage" Text="Messages :" runat="server"></asp:Label></div>
 
    <div class="ftv-wp-title ftv-reagir">laissez un commentaire</div>
 
    <div class="ftv-reagir-comment">
        <telerik:RadEditor ID="reComment" runat="server" EditModes="Design" ToolbarMode="ShowOnFocus" ToolsWidth="170px" Width="412px" Height="72px" ClientIDMode="Static">
 
            <Tools>
                <telerik:EditorToolGroup>
                    <telerik:EditorTool Name="Bold" />
                    <telerik:EditorTool Name="Italic" />
                    <telerik:EditorTool Name="StrikeThrough" />
                    <telerik:EditorTool Name="Underline" />
                    <telerik:EditorTool Name="InsertUnorderedList" />
                    <telerik:EditorTool Name="InsertOrderedList" />
                </telerik:EditorToolGroup>
            </Tools>
        </telerik:RadEditor>
        <span class="exp-bout-comm">
            <asp:Button ID="btSubmit" runat="server" Text="Valider" OnClick="btSubmit_Click" /></span>
        <%--<span class="exp-bout-comm"><asp:Button ID="btSubmit" runat="server" Text="Valider" OnClick="btSubmit_Click" CssClass="Exp-Comment-Submit"/></span>--%>
    </div>
</asp:Panel>
 
<asp:Panel ID="pnelAnonyme" runat="server">
</asp:Panel>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Publishing;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Web.UI;
 
namespace Expertime.PublishingComments.Library.Controls
{
    public partial class Comments : System.Web.UI.UserControl
    {
        #region Controls
        protected Button btSubmit;
        protected RadEditor reComment;
        protected Literal existingComments;
        protected GridView gv1;
        protected Literal newCommentLiteral;
        protected Label lblMessage;
        protected Panel panlcomments;
        protected Panel pnelAnonyme;
        private string _ValidationGroupId;
        private ValidationSummary _ErrorContainer;
        private ScriptManager _AjaxManager;
        #endregion
 
        #region vars & cons
        const string CommentListUrl = "ExpertimePublishingComments", CommentListTitle = "Expertime Comments";
        const string ExpertimePublishingCommentSiteFeatureId = "68af5cec-59a1-4105-97a7-3fb7b68fbf46";
        const string FieldName_ListItemId = "ListItemId", FieldName_CommentBody = "CommentBody";
        #endregion
 
        #region properties
        public ScriptManager AjaxManager
        {
 
            get { return _AjaxManager; }
 
            set { _AjaxManager = value; }
 
        }
        #endregion
 
        protected override void OnInit(EventArgs e)
        {
            Page.Init += delegate(object sender, EventArgs e_Init)
            {
                if (ScriptManager.GetCurrent(Page) == null)
                {
                    ScriptManager sMgr = new ScriptManager();
                    Page.Form.Controls.AddAt(0, sMgr);
 
                }
                string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];
                try
                {
                    if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")
                    {
 
                        Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";
 
                    }
                }
                catch { }
                try
                {
                    if (btSubmit == null)
                        btSubmit = this.FindControl("btSubmit") as Button;
 
                    if (reComment == null)
                        reComment = this.FindControl("reComment") as RadEditor;
 
                    if (existingComments == null)
                        existingComments = this.FindControl("existingComments") as Literal;
 
                    if (gv1 == null)
                        gv1 = this.FindControl("gv1") as GridView;
 
                    if (newCommentLiteral == null)
                        newCommentLiteral = this.FindControl("newCommentLiteral") as Literal;
 
                    GetExistingComments();
                }
                catch (Exception exc)
                {
                    existingComments.Text = string.Format("<span class=\"Exp-Error\">{0}</span>", exc.Message);
                }
                if (SPContext.Current.Web.CurrentUser == null)
                {
                    panlcomments.Visible = false;
                    pnelAnonyme.Visible = true;
                }
                else
                {
                    panlcomments.Visible = true;
                    pnelAnonyme.Visible = false;
                }
            };
            base.OnInit(e);
        }
 
 
 
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            if (!this.Controls.Contains(_ErrorContainer))
            {
                _ValidationGroupId = Guid.NewGuid().ToString();
                _ErrorContainer = new ValidationSummary();
                _ErrorContainer.ID = "_ErrorContainer";
                _ErrorContainer.ValidationGroup = _ValidationGroupId;
                _ErrorContainer.BorderStyle = BorderStyle.Solid;
                _ErrorContainer.BorderWidth = Unit.Pixel(3);
                _ErrorContainer.BorderColor = System.Drawing.Color.Red;
                this.Controls.Add(_ErrorContainer);
            }
 
           Literal HeaderTitle =this.FindControl("HeaderTitle") as Literal;
            if (HeaderTitle == null) throw new ArgumentNullException("le controle HeaderTitle n'existe pas");
 
            if (HttpContext.Current.User.Identity.IsAuthenticated)
                HeaderTitle.Text = "Réagir";
            else
            {
                                  HeaderTitle.Text = "<div class='ftv-wp-title ftv-title-separator'>Réagir</div>"+
                                                     "<div class='ftv-offline'><a><h6>Connectez-vous</h6> pour réagir</a></div>";
            }
 
        }
 
        private void GetExistingComments()
        {
            Guid siteId = SPContext.Current.Site.ID, webId = SPContext.Current.Web.ID;
            SPSecurity.RunWithElevatedPrivileges(delegate()
               {
                   using (SPSite elevatedSite = new SPSite(siteId))
                   {
                       using (SPWeb elevatedWeb = elevatedSite.OpenWeb(webId))
                       {
                           try
                           {
                               string prefixUrl = elevatedWeb.ServerRelativeUrl == "/" ? "/" : elevatedWeb.ServerRelativeUrl + "/";
                               SPList commentList = elevatedWeb.GetList(prefixUrl + CommentListUrl);
                               SPQuery query = new SPQuery();
                               string queryString = @"<OrderBy>
                                                      <FieldRef Name=""Created"" Ascending=""True"" />
                                                   </OrderBy>
                                                   <Where>
                                                      <Eq>
                                                         <FieldRef Name=""ListItemId"" />
                                                         <Value Type=""Text"">{0}</Value>
                                                      </Eq>
                                                   </Where>";
                               query.Query = string.Format(queryString, SPContext.Current.ListItem.UniqueId.ToString());
                               SPListItemCollection items = commentList.GetItems(query);
                               StringBuilder sb = new StringBuilder();
 
                               var NbCommentsLbl = this.FindControl("NbCommentsLbl") as Label;
                                if (NbCommentsLbl == null) throw new ArgumentNullException("le controle NbCommentsLbl n'existe pas");
                                
                               if (items.Count <= 1)
                                   NbCommentsLbl.Text = String.Format("{0} commentaire", items.Count.ToString());
                               else
                                   NbCommentsLbl.Text = String.Format("{0} commentaires", items.Count.ToString());
                             
 
                             //  SPField fieldListItemId = commentList.Fields.GetFieldByInternalName(FieldName_ListItemId);
                               SPField fieldCommentBody = commentList.Fields.GetFieldByInternalName(FieldName_CommentBody);
                               SPField fieldCreatedBy = commentList.Fields.GetFieldByInternalName("Author");
                               SPField fieldCreated = commentList.Fields.GetFieldByInternalName("Created");
 
                               foreach (SPListItem item in items)
                               {
                                   sb.Append("<div class=\"Exp-Comment\">");
 
                                   sb.Append("<div class=\"Exp-Comment-Header\">");
                                   sb.Append("<div class=\"Exp-Comment-Author\">");
                                   SPFieldUserValue fieldValue = fieldCreatedBy.GetFieldValue(item[fieldCreatedBy.Id].ToString()) as SPFieldUserValue;
                                   string userDisplayName = fieldValue.User.Name;
                                   sb.AppendFormat("<a style=\"cursor:text; TEXT-DECORATION: none;\">Publié par {0}</a>", userDisplayName);
                                   sb.Append("</div>");
                                   sb.Append("<div class=\"Exp-Comment-Date\">");
                                   sb.Append(item[fieldCreated.Id].ToString());
                                   sb.Append("</div>");
                                   sb.Append("</div>");
 
                                   sb.Append("<div class=\"Exp-Comment-Body\">");
                                   sb.Append(item[fieldCommentBody.Id].ToString());
                                   sb.Append("</div>");
 
                                   sb.Append("</div>");
                               }
                               
                               existingComments.Text = sb.ToString();
                           }
                           catch
                           {
                               //la liste n'existe pas
                               StringBuilder sb = new StringBuilder();
                               sb.Append("<div id=\"ExpComments\" class=\"Exp-Comments\">");
                               sb.Append("<div class=\"Exp-Comments-Number\"><span class=\"Exp-Comments-Number-Span\" >");
                               sb.AppendFormat("{0} commentaire ", "0");
                               sb.Append("</span></div>");
                               sb.Append("</div>");
                               existingComments.Text = sb.ToString();
                           }
                       }
                   }
               });
        }
 
        protected void btSubmit_Click(object sender, EventArgs e)
        {
            
            try
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    using (SPSite elevatedSite = new SPSite(SPContext.Current.Site.Url))
                    {
                        using (SPWeb elevatedWeb = elevatedSite.OpenWeb(SPContext.Current.Web.ServerRelativeUrl))
                        {
                            if (reComment.Content.Trim() != "")
                            {
                                SPList commentList = null;
                                try
                                {
                                    string prefixUrl = elevatedWeb.ServerRelativeUrl == "/" ? "/" : elevatedWeb.ServerRelativeUrl + "/";
                                    commentList = elevatedWeb.GetList(prefixUrl + CommentListUrl);
                                }
                                catch
                                {
                                }
                                //if the comment list cannot be found we create it
                                if (commentList == null)
                                {
                                    elevatedWeb.AllowUnsafeUpdates = true;
                                    Guid newListId = elevatedWeb.Lists.Add(CommentListTitle, "", CommentListUrl, ExpertimePublishingCommentSiteFeatureId, 100, "", SPListTemplate.QuickLaunchOptions.Off);
                                    commentList = elevatedWeb.Lists[newListId];
                                    elevatedWeb.AllowUnsafeUpdates = false;
                                }
                                SPList list = commentList;
 
 
                                elevatedWeb.AllowUnsafeUpdates = true;
                                //creating the comment item
                                SPListItem newComment = list.Items.Add();
                                SPField fieldListItemId = list.Fields.GetFieldByInternalName(FieldName_ListItemId);
                                SPField fieldCommentBody = list.Fields.GetFieldByInternalName(FieldName_CommentBody);
                                SPField fieldCreatedBy = list.Fields.GetFieldByInternalName("Author");
                                newComment[fieldListItemId.Id] = SPContext.Current.ListItem.UniqueId.ToString();
                                newComment[fieldCommentBody.Id] = reComment.Content;
                                SPFieldUserValue val = new SPFieldUserValue(SPContext.Current.Web, SPContext.Current.Web.CurrentUser.ID, SPContext.Current.Web.CurrentUser.LoginName);
                                newComment[fieldCreatedBy.Id] = val;
                                newComment.SystemUpdate();
 
                                elevatedWeb.AllowUnsafeUpdates = false;
 
                                //updating the new comment in the display
                                StringBuilder sb = new StringBuilder();
                                sb.Append("<div class=\"Exp-Comment\">");
 
                                sb.Append("<div class=\"Exp-Comment-Header\">");
                                sb.Append("<div class=\"Exp-Comment-Author\">");
 
                                string userDisplayName = SPContext.Current.Web.CurrentUser.Name;
                                string userEmail = SPContext.Current.Web.CurrentUser.Email;
                                sb.AppendFormat("<a style=\"cursor:text; TEXT-DECORATION: none;\">{1}</a>", userEmail, userDisplayName);
                                sb.Append("</div>");
                                sb.Append("<div class=\"Exp-Comment-Date\">");
                                sb.Append(DateTime.Now.ToLongDateString());
                                sb.Append("</div>");
                                sb.Append("</div>");
                                sb.Append("<div class=\"Exp-Comment-Body\">");
                                sb.Append(reComment.Content);
                                sb.Append("</div>");
 
                                sb.Append("</div>");
 
                                newCommentLiteral.Text = sb.ToString();
                                reComment.Content = string.Empty;
                                btSubmit.Visible = false;
 
                                reComment.Visible = false;
                                btSubmit.Visible = false;
                                lblMessage.Visible = false;
                            }
                        }
                    }
                });
            }
            catch
            {
            }
        }
 
        
 
        public void RegisterError(string message)
        {
 
            if (this.Controls.Contains(_ErrorContainer))
            {
 
                //this way of generating a unique control id is used in some of the OOB web parts
 
                int uniqueCounter;
 
                if (HttpContext.Current.Items["GetUniqueControlId"] != null)
                {
 
                    uniqueCounter = (int)HttpContext.Current.Items["GetUniqueControlId"];
 
                }
 
                else
                {
 
                    uniqueCounter = 0;
 
                }
 
                uniqueCounter++;
 
                HttpContext.Current.Items["GetUniqueControlId"] = uniqueCounter;
 
 
 
                //create a custom validator to register the current error message with the ValidationSummary control
 
                CustomValidator cv = new CustomValidator();
 
                cv.ID = string.Concat("_Error_", uniqueCounter);
 
                cv.ValidationGroup = _ValidationGroupId;
 
                cv.Display = ValidatorDisplay.None;
 
                cv.IsValid = false;
 
                cv.ErrorMessage = message;
 
 
 
                this.Controls.Add(cv);
 
            }
 
            else
            {
 
                //if RegisterError is called before the CreateChildControls override in AjaxBasePart then transfer the user to an error page using the SPUtility
 
                Microsoft.SharePoint.Utilities.SPUtility.TransferToErrorPage("The CreateChildControls function of the AjaxBasePart has not been called.  You probably need to add \"base.CreateChildControls()\" to the top of your CreateChildControls override.");
 
            }
 
        }
    }
}
0
Danail Vasilev
Telerik team
answered on 01 Aug 2013, 04:56 PM
Hi Renato,

I can suggest you to examine RadEditor Content Not Saved After Ajax Update in IE9, Firefox, Google Chrome and Safari KB that treats similar issues.

Could you, please try using some of the approaches listed in the provided KB (e.g. setting the UseSubmitBehavior of the postback buttons to false) and then tell me whether this fixes the mentioned issue?


Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Kyle
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Jerome
Top achievements
Rank 1
Renato
Top achievements
Rank 1
Dyanko
Telerik team
Danail Vasilev
Telerik team
Share this question
or