This topic is locked

In Place Document Editing for uploaded documents

10/19/2025 20:26:28
ASPRunner.NET General questions
C
Chris Lietz author

Has anyone setup an In Place Document Editor to Edit and Save Uploaded Documents?

I have looked at https://www.textcontrol.com/ . Has anyone does this integration?

Thank you

ChatGPT 10/19/2025

Integrating an In Place Document Editor like Text Control with ASPRunner.NET to edit and save uploaded documents is certainly possible, but it requires some custom development. Here's a general approach you can follow:

Steps to Integrate Text Control with ASPRunner.NET

  1. Set Up Your ASPRunner.NET Project:

    • Ensure your ASPRunner.NET project is set up and you have a database table for storing document metadata (e.g., file name, file path, upload date).


  2. Upload Documents:

    • Implement a file upload feature where users can upload documents to your server. You can use ASPRunner.NET's built-in file upload capabilities to handle this.


  3. Integrate Text Control:

    • Purchase the Text Control library if you haven't already. Follow the documentation provided by Text Control for installation and setup.
    • Add the necessary references to the Text Control libraries in your ASPRunner.NET project.


  4. Display the Document for Editing:

    • Once a document is uploaded, retrieve its content. You can load the document into the Text Control editor for in-place editing.
    • Use the appropriate API methods provided by Text Control to load the document into the editor.


  5. Handle Document Editing:

    • Set up event handlers to save changes made in the Text Control editor. You will likely need to serialize the document content and save it back to the server.


  6. Save Edited Documents:

    • When the user finishes editing and clicks "Save," capture the document content from the Text Control editor and save it to your server. You may need to handle file formats appropriately (e.g., .docx, .pdf).


  7. Testing:

    • Thoroughly test the integration to ensure that documents can be uploaded, edited, and saved correctly without any errors.


  8. Security Considerations:

    • Implement proper security measures to ensure that users can only access and edit their own documents.



Example Code Snippet

Here is a very simplified example of how you might handle the saving of an edited document:

protected void btnSave_Click(object sender, EventArgs e)
{
// Assuming 'editor' is your Text Control editor
string documentContent = editor.GetDocumentContent(); // Get the content from the editor
string filePath = Server.MapPath("~/UploadedDocuments/") + "yourDocumentName.docx"; // Define your path

// Save the document content to a file
File.WriteAllText(filePath, documentContent);

// Optionally, update your database with the new file path or metadata
UpdateDatabaseWithFileInfo(filePath);
}

Conclusion

Integrating an In Place Document Editor like Text Control with ASPRunner.NET requires custom coding, but it can be accomplished by following the steps outlined above. If you need specific help with code or have additional questions about the integration, feel free to ask!