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

Changing Dialog Templates - class not working

2 Answers 62 Views
Window
This is a migrated thread and some comments may be shown as answers.
GlenB
Top achievements
Rank 1
GlenB asked on 30 Jun 2010, 05:45 AM
I am trying to convert my declarative RadConfirm template over to a class and have followed the steps outlined here (twice):
http://www.telerik.com/help/aspnet-ajax/window_dialogschangingthedialogtemplates.html
but it's not working.

When putting the code into the page_load event I get an error on this line:
Me.RadWindowManager1.ConfirmTemplate = New ConfirmTemplate(Me.Page)
The error is:
Error   5   Type 'ConfirmTemplate' is not defined. 

My class file is (ascx):
<%@ Control Language="VB" ClassName="ConfirmTemplate" %> 
<div class="rw_Confirm_Wrapper"
    <div class="rw_ConfirmText"
        {1} 
    </div> 
    <div class="rw_ConfirmButtonsWrapper"
        <div class="rw_ConfirmButtons" style="float: left;" onclick="$find('{0}').close(false);"
            Cancel</div> 
        <div class="rw_ConfirmButtons" style="float: right;" onclick="$find('{0}').close(true);"
            Proceed</div> 
    </div> 
</div> 
 

and (ascx.vb):
Class ConfirmTemplate 
    Implements ITemplate 
    Private _page As Page 
    Public Sub New(ByVal page As Page) 
        Me._page = page 
    End Sub 
    Sub InstantiateIn(ByVal owner As Control) Implements ITemplate.InstantiateIn 
        Dim ctrl As Control = _page.LoadControl("ConfirmTemplate.ascx") 
        owner.Controls.Add(ctrl) 
    End Sub 
End Class 

I have followed the example exactly also (using c#) with an AlertTemplate and got the same error.

I would welcome any assistance with this - thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 01 Jul 2010, 12:20 PM
Hi GlenB,

Please find attached a small sample that implements the approach described in the help article.

Greetings,
Georgi Tunev
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
GlenB
Top achievements
Rank 1
answered on 02 Jul 2010, 11:39 PM
That's great, thanks. 

I was putting my Class ConfirmTemplate section in the wrong file.
Tags
Window
Asked by
GlenB
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
GlenB
Top achievements
Rank 1
Share this question
or