我研究并尝试了 3 种不同的解决方案,但无法克服恼人的错误:
Uncaught ReferenceError: SetupRichTextAndTags is not defined
情况 :
我正在使用数据(C# 后端)填充隐藏字段,这纯粹是 HTML,我将通过调用以下 javascript 来填充 SummerNote 富文本字段:
$(".summernote").code("your text");
我在 RegisterStartupScript 的尝试:
//ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script", "$(function () { SetupRichTextAndTags(); });", true);
//ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>SetupRichTextAndTags();</script>", false);
ScriptManager.RegisterStartupScript(Page, GetType(), "SetupRichTextAndTags", "<script>SetupRichTextAndTags()</script>", false);
所有这些都给了我错误...
该脚本本身位于 aspx 页面中包含的 javascript 文件中,我认为这可能是问题所在。但是..我还没有找到任何解决方案来实际解决这个问题..
有小费吗 ?