Imports Telerik.Web.UI
Partial Class TestPage
Inherits System.Web.UI.Page
Protected Sub Start_RadButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Start_RadButton1.Click
ShowRadWindowWithContent(RadTextBox7.Text)
End Sub
Protected Sub Start_RadButton2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Start_RadButton2.Click
ShowRadWindowWithContent(RadTextBox8.Text)
End Sub
Private Sub ShowRadWindowWithContent(ByVal content As String)
' Encode content to be safely used in JavaScript
Dim encodedContent As String = HttpUtility.JavaScriptStringEncode(content)
' Register JavaScript to update and show the RadWindow
Dim script As String = "function openRadWindow() { " _
& " var radWindow = $find('" & RadWindow2.ClientID & "'); " _
& " if (radWindow) { " _
& " var contentLabel = radWindow.get_contentElement().querySelector('#DynamicLabel'); " _
& " if (contentLabel) { " _
& " contentLabel.innerHTML = '" & encodedContent & "'; " _
& " } " _
& " radWindow.show(); " _
& " } " _
& "} openRadWindow();"
RadScriptManager.RegisterStartupScript(Me, Me.GetType(), "ShowRadWindow", script, True)
End Sub
End Class
<%@ Page Language="vb" AutoEventWireup="false" CodeFile="TestPage.aspx.vb" Inherits="TestPage" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dynamic RadWindow Example</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadWindow ID="RadWindow2" runat="server" Modal="True" Skin="Metro" Visible="false">
<ContentTemplate>
<div class="content-container">
<div class="rad-label">
<telerik:RadLabel Text="Start Task?" runat="server" style="color: azure" />
</div>
<div id="contentContainer">
<telerik:RadLabel ID="DynamicLabel" runat="server" />
</div>
<div class="button-container">
<asp:Button ID="Button1" runat="server" Text="Start" />
<asp:Button ID="Button2" runat="server" Text="Cancel" />
</div>
</div>
</ContentTemplate>
</telerik:RadWindow>
<telerik:LayoutRow>
<Columns>
<telerik:LayoutColumn Span="3" SpanXs="0" SpanSm="0">
<div class="col">
<label>Test: </label>
</div>
</telerik:LayoutColumn>
<telerik:LayoutColumn Span="8" SpanXs="12" SpanSm="12">
<telerik:RadTextBox ID="RadTextBox7" RunAt="server"/>
<telerik:RadButton ID="Start_RadButton1" runat="server" Text="Start" OnClick="Start_RadButton1_Click" />
</telerik:LayoutColumn>
</Columns>
</telerik:LayoutRow>
<telerik:LayoutRow>
<Columns>
<telerik:LayoutColumn Span="3" SpanXs="0" SpanSm="0">
<div class="col">
<label>TimeStamp: </label>
</div>
</telerik:LayoutColumn>
<telerik:LayoutColumn Span="8" SpanXs="12" SpanSm="12">
<telerik:RadTextBox ID="RadTextBox8" RunAt="server"/>
<telerik:RadButton ID="Start_RadButton2" runat="server" Text="Start" OnClick="Start_RadButton2_Click" />
<telerik:RadButton ID="RadButton22" runat="server" Text="Completed"/>
</telerik:LayoutColumn>
</Columns>
</telerik:LayoutRow>
</form>
</body>
</html>
So i have the following ItemTemplate defined for a RadGrid
<telerik:GridTemplateColumn DataField="Description" HeaderText="Description">
<ItemTemplate>
<iframe>
<telerik:RadEditor ID="ContentEditor1" onClientLoad="OnClientLoad" CssClass="Modal-Scroll2" Enabled="false" ToolsFile="~/ToolsFileEmpty.xml" runat="server" EditModes="Preview" NewLineMode="br" ContentFilters="DefaultFilters" Width="100%" >
<CssFiles>
<telerik:EditorCssFile Value="~/css/EditorStyles.css" />
</CssFiles>
</telerik:RadEditor>
</iframe>
</ItemTemplate>
</telerik:GridTemplateColumn>
However, when this renders on the page, the editor content appears in the wrong place:
and the end result is a bunch of empty iframes:
Ideas?
-Mark
I have blocks of HTML that are entered (usually copy and pasted in from email messages) by users of our system. We don't know what this content will contain, or if the content (html) is even completed (maybe the copied part of a HTML message). For that reason we display the content in a radeditor. This content is read-only, so we set the Enabled property of the RadEditor to "false". However when we do that, the content is no longer displayed in an iframe, despite using ContentAreaMode="Iframe".
When the editor is Enabled, it renders like this instead:
The reason that we are trying to have the content rendered in an IFRAME is because this content sometimes includes CSS/Styles that modify the content in the parent container.
For instance today we discovered this HTML embedded into a <style> tag.
div { display: block !important; visibility: visible !important; opacity: 1 !important }
And this caused all kinds of rendering problems on the page because it forced a ton of modal popup <div>'s to become visible that should be hidden.
Thanks for your help!
-Mark
Hi,
I cannot see the latest two downloaded version in my Update Wizard screen.
They are in the Update folder though, see screenshots.
VS 2022 Community with latest Telerik VS Extension.
Any suggestions?
Marc
Hi,
Since the Microsoft.WindowsAzure.Storage is already deprecated, the RadCloudUpload is broken. Is there a solution for this or alternatives that you can suggest? Thank you
Hi !
I've got strange behavior with RadAjaxManager.I am trying to open a new window when a user clicks a button but need to pass 'CallLogID' into my query parameters. For the life of me I can not seem to get the CallLogID to show up. The value of CallLogID is in a datafield set to Display="False". I have tried using <%# Eval() %> but maybe I am not using the appropriate escape characters. Any help would be much appreciated.
Here are my code snippets that are currently working to open a new tab and navigate to the specified URL.
<telerik:GridTemplateColumn HeaderText="Follow Up" UniqueName="FollowUp">
<HeaderStyle Width="22%" />
<ItemStyle Width="22%" />
<ItemTemplate>
<asp:LinkButton ID="lnkFollowUp" runat="server" OnClick="FollowUpView" ToolTip="Follow Up">
(<%# Eval("FollowUpCount") %>) view
</asp:LinkButton>
<asp:Literal ID="separator" runat="server" Text=" | " />
<asp:LinkButton ID="FollowUpAdd" runat="server" Text="add" ToolTip="Follow Up" OnClientClick="window.open('addfollowuptocalllog.aspx?calllogid=', '_blank'); return false;"/>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="CallLogID" UniqueName="CallLogID" Visible="True" Display="False">
<ColumnValidationSettings>
<ModelErrorMessage Text=""></ModelErrorMessage>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
I recently discovered your "Mentions" feature in WinForms and am looking to produce a WebForms version of this. I did get close to creating this functionality; very close, actually. Building it within the RadEditor has proven to be problematic, as the HTML created by the Editor tended to wreak havoc on my code. It was pretty granular, in that I used character counts to track and locate "tagged"/"mentioned" users.
Is there a WebForms version of this coming soon? If not, can you offer some guidance on how to overcome some issues the Editor creates?