If
x.CheckUserAndPassword(txtUsername.Text, txtCurrentPassword.Text, txtNewPassword.Text) Then
lblerror.Enabled =
True
lblerror.Text =
"Change Success"
Threading.Thread.Sleep(5000)
Response.Redirect(
"~/Login.aspx", False)
Else
lblerror.Text =
"Try Again, Your username or password does not match"
End If
I try create MossRadEditor Custom Field in SharePoint when build & debug I run pass but on webpage error "An unexpected error has occurred" :(.
file ascx:
<%@ Control Language="C#" Debug=true %>
<%@ Register Assembly="RadEditorSharePoint, Version=5.3.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed"
Namespace="Telerik.SharePoint" TagPrefix="cc1" %>
<%@ Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.WebControls" %>
<SharePoint:RenderingTemplate ID="CMSDropDownFieldControl" runat="server">
<Template>
<cc1:MOSSRadEditor ID="MOSSRadEditor1" runat="server" Width ="450px" Height ="400px">
</cc1:MOSSRadEditor>
</Template>
</SharePoint:RenderingTemplate>
CMSDropDownFieldControl.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using Microsoft.SharePoint.WebControls;
using System.Security.Principal;
using System.Security.Permissions;
using Microsoft.SharePoint;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using Telerik.SharePoint;
namespace Prevail.CMS.CustomFields
{
class CMSDropDownFieldControl : BaseFieldControl
{
protected MOSSRadEditor mossRadEditor;
protected override string DefaultTemplateName
{
get
{
return "CMSDropDownFieldControl";
}
}
public override object Value
{
get
{
EnsureChildControls();
return mossRadEditor.Text;
}
set
{
EnsureChildControls();
mossRadEditor.Text = (string)this.ItemFieldValue;
}
}
public override void Focus()
{
EnsureChildControls();
}
protected override void CreateChildControls()
{
if (Field == null) return;
base.CreateChildControls();
try
{
if (ControlMode == Microsoft.SharePoint.WebControls.SPControlMode.Display)
return;
mossRadEditor = (MOSSRadEditor)TemplateContainer.FindControl("MOSSRadEditor1");
}
catch (SPException ex)
{
}
}
}
}
CMSDropDownField.cs
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
namespace Prevail.CMS.CustomFields
{
public class CMSDropDownField:SPFieldText
{
#region
Constructors
public CMSDropDownField(SPFieldCollection fields, string fieldName) : base(fields, fieldName)
{
}
public CMSDropDownField(Microsoft.SharePoint.SPFieldCollection fields, string typeName, string displayName) : base(fields, typeName, displayName)
{
}
#endregion
/// <summary>
/// Here we can apply formating to our number that will show up on the edit page.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public override object GetFieldValue(string value)
{
if (String.IsNullOrEmpty(value))
return null;
return value;
}
public override Microsoft.SharePoint.WebControls.BaseFieldControl FieldRenderingControl
{
get
{
Microsoft.SharePoint.WebControls.BaseFieldControl _CMSDropDownFieldControl = new CMSDropDownFieldControl();
_CMSDropDownFieldControl.FieldName = InternalName;
return _CMSDropDownFieldControl;
}
}
}
}

| <telerik:RadComboBox |
| Id="SearchCombo" |
| Runat="server" |
| EnableLoadOnDemand="True" |
| OnItemsRequested="SearchCombo_ItemsRequested" |
| LoadingMessage="Searching..." |
| EmptyMessage="Search ..." |
| Height="15px" |
| Width="315px" |
| DropDownWidth="400px" |
| Skin="Sunset" |
| OnSelectedIndexChanged="SearchCombo_SelectedIndexChanged" |
| OnClientItemsRequesting="HandleRequestStart" |
| OnClientKeyPressing="HandleKeyPress" |
| BorderColor="Transparent" |
| CollapseDelay="200" |
| ExpandDelay="300" |
| ItemRequestTimeout="200" |
| ShowDropDownOnTextboxClick="False" |
| ShowWhileLoading="False" |
| AutoPostBack="true" |
| ShowToggleImage="False" |
| ShowMoreResultsBox="True" |
| CausesValidation="False" |
| OnClientItemsRequested="HandleRequestEnd" |
| OnClientBlur="OnClientBlur" |
| HighlightTemplatedItems="True"> |
| <ItemTemplate> |
| <div class="AssocSearchItemContainer" > |
| <div style=" float:left;"> |
| <img alt='<%# Eval("Title")%>' height="40px" src='<%# Eval("ThumbnailURL")%>' /> |
| </div> |
| <div class="AssocSearchItemTextBlock"> |
| <strong><%# Eval("Title")%></strong><br /> |
| <%# Eval("Description")%><br /> |
| <%# Eval("Details")%><br /> |
| </div> |
| </div> |
| </ItemTemplate> |
| <CollapseAnimation Duration="100" Type="OutQuint" /> |
| <ExpandAnimation Type="None" /> |
| </telerik:RadComboBox> |
| protected void SearchCombo_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) |
| { |
| .... |
| .... |
| if (searchPhrase.Length == 0) |
| { |
| comboBox.ClearSelection(); |
| comboBox.Height = 0; |
| e.Message = "Enter a search phrase."; |
| return; |
| } |
| .... |
| .... |
| } |
Thanks
Imtiaz