Protected
Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim Title, Abstract, Comments As String
Dim Display As Integer
Dim NewsDate As Date
Title =
Me.rtxtTitle.Text
Abstract =
Me.redAbstract.Text
Dim strAbstract = Abstract.Substring(0, Abstract.Length - 1)
Comments =
Me.redComments.Text
Dim strComments = Comments.Substring(0, Comments.Length - 1)
NewsDate =
Me.rdtpNews.DbSelectedDate
If Me.chkDisplayYN.Checked = True Then
Display = 1
Else
Display = 0
End If
'Populate the datatable
Dim sConnString As String = ConfigurationManager.ConnectionStrings("PU89").ConnectionString
Dim objConnection As New SqlClient.SqlConnection(sConnString)
Dim strSQL As String = "INSERT INTO tblNews (Title,Display,BDate,Abstract,Comments)" & _
" VALUES ('" & Title & "', '" & Display & "', '" & NewsDate & "', '" & strAbstract & "', '" & strComments & "');"
Dim dbComm As New SqlClient.SqlCommand(strSQL, objConnection)
Dim iID As Integer
Try
objConnection.Open()
iID = dbComm.ExecuteScalar()
Catch ex As Exception
Response.Write(ex.Message)
Response.End()
Finally
If objConnection.State = ConnectionState.Open Then
objConnection.Close()
End If
End Try
End Sub
This method works for short blocks of text with no special characters. When I try to enter the complete text (copied from a webpage and pasted into the RadEditor) I get syntax errors:
"Incorrect syntax near 's'. Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon."
Thanks,
Shelley

OnAppointmentClick event so that I can redirect to a different page with the DataKeyField's value sent along with it, which will be used to pull and display detailed data from the database. I've searched the forums and can't seem to find out how this is done. The scheduler is a read-only scheduler so using events that fire on modified appointments will not work.
The code is here:
| <telerik:RadScheduler ID="ChangeCalendar" runat="server" DataKeyField="ChangeControlID" |
| DataSubjectField="ChangeControlNumber" DataStartField="TargetStartDate" |
| DataEndField="TargetEndDate" AllowDelete="False" OverflowBehavior="Expand" |
| OnAppointmentClick="ChangeCalendar_OnAppointmentClick" |
| ReadOnly="True" SelectedView="MonthView"> |
| </telerik:RadScheduler> |
I know this has to be easy... but I cannot seem to find anything about how to do this.
Thanks.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<asp:Button ID="Button1" runat="server" Text="Button" />
<telerik:RadGrid ID="gridAccounts" runat="server" PageSize="20" AllowPaging="True"
DataSourceID="ObjectDataSource1">
<MasterTableView AutoGenerateColumns="false">
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="Name">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Amount" HeaderText="Amount">
</telerik:GridBoundColumn>
</Columns>
<PagerStyle Visible="true" Mode="NextPrevNumericAndAdvanced" />
</MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData"
EnablePaging="true" SelectCountMethod="SelectCount" StartRowIndexParameterName="offset"
MaximumRowsParameterName="count" TypeName="Class1">
<SelectParameters>
<asp:ControlParameter Name="searchContext" ControlID="ObjectDataSource1" PropertyName="NamingContainer.Page.SearchContext" />
</SelectParameters>
</asp:ObjectDataSource>
</form>
</body>
</html>
using System;
public partial class _Default : System.Web.UI.Page
{
public SearchContext SearchContext
{
get
{
return new SearchContext() { MinAmount = 10 };
}
}
}
using System;
using System.Collections.Generic;
public class Class1
{
public Transaction[] GetData(SearchContext searchContext, int offset, int count)
{
List<Transaction> transactions = new List<Transaction>();
for (int i = 0; i < 3; ++i)
transactions.Add(new Transaction() { Name = "T" + i, Amount = i });
return transactions.ToArray();
}
public int SelectCount(SearchContext searchContext)
{
return 3;
}
}
public class Transaction
{
public string Name { get; set; }
public int Amount { get; set; }
}
[Serializable]
public class SearchContext
{
public int MinAmount { get; set; }
}
| <telerik:RadWindowManager ID="radWindows" runat="server" Left="" Modal="True" |
| Top="" VisibleStatusbar="false" VisibleTitlebar="True" Behaviors="Close"> |
| <Windows> |
| <telerik:RadWindow |
| ID="radEditPullDetail" |
| runat="server" |
| Height="568px" |
| Width="824px" |
| Title="Details" |
| ClientCallBackFunction="CallBackFunction" |
| Behaviors="Maximize,Close" |
| > |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| "window.radopen('newpage.aspx','radEditPullDetail'); return false;" |