Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Saving html in abpsettings table #6612


User avatar
0
uabel created

Hi, I'm trying to save html content in my settings variable. Everything works fine and it is saved in table. After reloading my application an error occurs: AbpScripts/GetScripts\n\nSCRIPT1015: Nicht abgeschlossene Zeichenfolgenkonstante

Is it possible to save html content in this table?


5 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Can you show how you are saving the HTML content? Newlines should be \n.

  • User Avatar
    0
    uabel created

    We are using the ckeditor. var objEditor = CKEDITOR.instances["helpEditor"]; if (objEditor) { $scope.commonValues.HelpEditorContent = objEditor.getData(); } this is saved into my variable: "<p>this is my text</p>\n\n<p>with newline</p>\n"

    In c# the html is shown correctly but then saving to database removes newlines `

    Text mit Umbruch

    da issa

    `
  • User Avatar
    0
    aaron created
    Support Team

    It's not removed, you can see it's rendered.

    What's the value when you use GetSettingForUser?

  • User Avatar
    0
    uabel created

    Here is the value in the PostInitialize function:

    And here the error which is shown after that:

  • User Avatar
    0
    aaron created
    Support Team

    Which versions are you on?

    • ABP:
    • ASP<span></span>.NET Zero: