Description: RadEditor's TemplateManager adds a non-existing template into RadEditor.
Problem: The application has a save function that captures RadEditor1's content into an HTML file, "test.html", on the local disk. This file is saved into "~/Templates/test.html". The problem occurs when test.html is edited and reloaded; TemplateManager somehow stores the first copy of test.html and keeps loading it whenever a file named test.html is opened by TemplateManager. test.html can be edited through RadEditor, or Notepad, or even deleted and re-created, but TemplateManager still opens the original copy(which has been deleted and re-created and formatted differently than before).
Code:
[ASPX]
<
TemplateManager ViewPaths="~/Templates" />
[C#]
if
(e.Argument == "Save")
{
using (StreamWriter saveFile = new StreamWriter(this.MapPath(path), false))
{
saveFile.Write(RadEditor1.Content);
}
}
Any help will be greatly appreciated.
Thank you

protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
//Get the GridEditableItem of the RadGrid
GridEditableItem editedItem = e.Item as GridEditableItem;
//Get the primary key value using the DataKeyValue.
string ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["id"].ToString();
//Access the textbox from the edit form template and store the values in string variables.
string name = (editedItem["name"].Controls[0] as CheckBox).Text;
string insertflag = (editedItem["insertflag"].Controls[0] as CheckBox).Text;
string updateflag = (editedItem["updateflag"].Controls[0] as CheckBox).Text;
try
{
//Open the SqlConnection
SqlConnection.Open();
//Update Query to update the Datatable
string updateQuery = "UPDATE Employees set name='" + name + "',insertflag='" + insertflag + "',updateflag='" + updateflag + "' where id='" + ID + "'";
SqlCommand.CommandText = updateQuery;
SqlCommand.Connection = SqlConnection;
SqlCommand.ExecuteNonQuery();
//Close the SqlConnection
SqlConnection.Close();
}
catch (Exception ex)
{
RadGrid1.Controls.Add(
new LiteralControl("Unable to update Employee. Reason: " + ex.Message));
e.Canceled =
true;
}
Label1.Text =
"Updated";
}
I have used label to change text to know whether it get into updatecommand or not, but no changes happens.
Are there any c# additional code to add???
Please advise
Regards
function
GotoNewRequestPage()
{
var obj = document.getElementById('<%= RadGridRequestLists.ClientID %>');
}
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
I have two treeviews on a page within RadAjaxPanels (tried this with basic divs to the same result) and have found something a little odd that I could do with a fix for. If I drag an object from the right tree as soon as I enter the left panel I get an error on line 1911, char 1, Error '_145' is null or not an object. After doing some more research I discovered that this only happens when I drag something out of the left edge of RadAjaxPanel2 and into the right edge of RadAjaxPanel1.
e.g. if I drag out of the bottom of RadAjaxPanel2 and onto RadAjaxPanel1 from the right it's fine, if I drag out of the left of RadAjaxPanel2 and into the top edge of RadAjaxPanel1 again it's fine, but if I drag from the left edge of RadAjaxPanel2 onto the right edge of RadAjaxPanel1 I get the error (needs IE to be setup to show all Javascript errors for the error to be obvious).
As a temporary fix I can swap the trees round so that I am dragging from the left tree to the right tree, but this isn't an idea solution, has anyone encountered this before or got any ideas how I can solve this?
Cheers
Jon
| <asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
| <contentTemplate> |
| //CODE REMOVED TO KEEP SIZE DOWN |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" BackColor="Aqua" CssClass="floatLeft"> |
| <telerik:RadTreeView ID="RadTreeGroups" AllowNodeEditing="true" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true" OnNodeDrop="RadTreeGroups_NodeDrop" OnNodeEdit="RadTreeGroups_NodeEdit" OnClientContextMenuItemClicked="onClientContextMenuItemClicked" OnContextMenuItemClick="RadTreeGroups_ContextMenuItemClick" runat="server"> |
| </telerik:RadTreeView> |
| </telerik:RadAjaxPanel> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" BackColor="Gray" CssClass="floatRight"> |
| <telerik:RadTreeView ID="RadTreeResources" runat="server" EnableDragAndDrop="true" OnNodeDrop="RadTreeLessons_NodeDrop"> |
| </telerik:RadTreeView> |
| </telerik:RadAjaxPanel> |
| </contentTemplate> </asp:UpdatePanel> |
| .floatRight |
| { |
| float:right; |
| width:48%; |
| } |
| .floatLeft |
| { |
| float:left; |
| width:48%; |
| } |