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

WSS integration with custom page

2 Answers 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 2
Iron
Iron
Pierre asked on 31 Aug 2009, 09:17 PM
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=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> 
 
<%@ Page Language="vb"   
    Inherits="ExtranetArbaultWssAddon.NouvUsager, ExtranetArbaultWssAddon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d71c63e255e32165"   
    MasterPageFile="simple.master"      %> 
 
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>   
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>   
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>   
<%@ Import Namespace="Microsoft.SharePoint" %> 
 
<asp:Content ID="Content5" ContentPlaceHolderId="PlaceHolderMain" runat="server">  
    <telerik:RadTextBox ID="RadTextBox1" runat="server">  
    </telerik:RadTextBox> 
</asp:Content> 

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 
        Get 
            Return True 
        End Get 
    End Property 
    Protected Overloads Overrides ReadOnly Property AllowNullWeb() As Boolean 
        Get 
            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  
        Me.Controls.Add(test)  
 
    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.

Question:
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?

Thanks

2 Answers, 1 is accepted

Sort by
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 01 Sep 2009, 03:52 PM

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

 

0
Sebastian
Telerik team
answered on 04 Sep 2009, 06:27 AM
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,
Sebastian
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.
Tags
General Discussions
Asked by
Pierre
Top achievements
Rank 2
Iron
Iron
Answers by
Pierre
Top achievements
Rank 2
Iron
Iron
Sebastian
Telerik team
Share this question
or