
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. |
|