Having issues trying to get multiple textboxes to populate a single rad window depending on which submit button is clicked. I am trying to eventually output from rad window as it will post with what ever information I pull output onto window and then the start button will then timestamp. I am mainly just doing this piece by pice and want to just output something. This is the code that I have so far.
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>