WSS integration with custom page

3 posts, 0 answers
  1. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 31 Aug 2009 Link to this post

    hi, we use FormBaseAuthentication in WSS 3.0.

    I create a "new user" aspx page to let new user to create a profile. We want to use Teletik control (Panel, textbox, ...) in this page.
    I follow the great article to enable Telerik and .net 3.5 on WSS. I try with the webparts example that you provide, it work good. But now I try to add some telerik control to my custom NouvUsager.aspx. If I simply drag and drop a telerik control on my aspx page, deploy it and try, I god a "could not load assemblies" error. (but the Telerik.web.ui.dll are in the GAC). 

    my aspx code without the reference to telerik:
    <%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> 
    <%@ Page Language="vb"   
        Inherits="ExtranetArbaultWssAddon.NouvUsager, ExtranetArbaultWssAddon, Version=, Culture=neutral, PublicKeyToken=d71c63e255e32165"   
        MasterPageFile="simple.master"      %> 
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>   
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>   
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>   
    <%@ Import Namespace="Microsoft.SharePoint" %> 
    <asp:Content ID="Content5" ContentPlaceHolderId="PlaceHolderMain" runat="server">  
        <telerik:RadTextBox ID="RadTextBox1" runat="server">  

    My vb class linked in the Inherit section:
    Imports System  
    Imports System.Runtime.InteropServices  
    Imports System.Web.UI  
    Imports System.Web.UI.WebControls  
    Imports System.Web.UI.WebControls.WebParts  
    Imports System.Xml.Serialization  
    Imports Microsoft.SharePoint  
    Imports Microsoft.SharePoint.WebControls  
    Imports Microsoft.SharePoint.WebPartPages  
    Imports Telerik.Web.UI  
    Partial Public Class NouvUsager  
        Inherits Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase  
        Protected Overloads Overrides ReadOnly Property AllowAnonymousAccess() As Boolean 
                Return True 
            End Get 
        End Property 
        Protected Overloads Overrides ReadOnly Property AllowNullWeb() As Boolean 
                Return True 
            End Get 
        End Property 
        Private Sub Page_Init(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Init  
            'Ajout du scrip manager au besoin  
            Dim scriptManager As RadScriptManager = RadScriptManager.GetCurrent(Me.Page)  
            If scriptManager Is Nothing Then 
                scriptManager = New RadScriptManager  
                Me.Page.Form.Controls.AddAt(0, scriptManager)  
            End If 
            Page.ClientScript.RegisterStartupScript(GetType(NouvUsager), Me.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;"True)  
            If Me.Page.Form Is Nothing Then 
                Dim formOnSubmitAtt As String = Me.Page.Form.Attributes("onsubmit")  
                If Not String.IsNullOrEmpty(formOnSubmitAtt) AndAlso formOnSubmitAtt = "return _spFormOnSubmitWrapper();" Then 
                    Me.Page.Form.Attributes("onsubmit") = "_spFormOnSubmitWrapper();" 
                End If 
            End If 
            Dim test As New RadTextBox  
        End Sub 
    Like you can see at the end of the init page, I add a radTexbox (like in the webpart example) but nothing appear on the form. But with this code not error are raised.

    1- It ok to replace the GetType(Webpart1) to GetType(NouvUsager) in this:
    Page.ClientScript.RegisterStartupScript(GetType(NouvUsager), Me.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;"True)

    2- How can I add with drag and drop control to my aspx page without the could not load assemblie error?
    3- Do you have a good sample for creating a complex ascx (usercontrol) with some Telerik control added into a webpart?

  2. Pierre
    Pierre avatar
    212 posts
    Member since:
    Apr 2007

    Posted 01 Sep 2009 Link to this post

    Ok I fond some part of the problem. I use the wrong telerik control (the one for .net2.0). I change the Assembly for this one that use the good GAC dll.


    @ Register Assembly="Telerik.Web.UI, Version=2009.2.701.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    But now with this declaration, the page disply OK, but I alway got this warning on the top of my apsx page:
    RadTextbox is ambiguious in the namespace telerik.web.ui


  3. DevCraft R3 2016 release webinar banner
  4. Sebastian
    Sebastian avatar
    9934 posts

    Posted 04 Sep 2009 Link to this post

    Hello Pierre,

    Can you please verify that you removed all previous references to the RadInput.Net2 assembly, cleared the VS cache and restarted the development environment to ensure that the RadTextBox control source will be referenced from the Telerik.Web.UI source when building/compiling your project? Also verify that you reference the RadTextBox from the code-behind using the Telerik.Web.UI namespace instead of Telerik.WebControls.

    This should help you eliminate the ambiguous error you receive.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top