c# - asp c# 基本mailto函数

标签 c# javascript asp.net

我一直在尝试使用类似于 Java 中使用的 '\n' 进入下一行,但它似乎在这个脚本中不起作用。

'\n' 不起作用,但整个函数没有它就可以工作。

我的问题是你如何转到下一行?

    String text_name = Text_Name.Text;
    String text_email = Text_Email.Text;
    String text_message = Text_Message.Text;

    ClientScript.RegisterStartupScript(this.GetType(), "mailto",

       "<script type = 'text/javascript'>parent.location='mailto:" + "someone@gmail.com" +

       "?subject=" + "Inquiry" +

       "&body=" + 

       "Contact Name: " + text_name + '\n' +

       "Contact By: " + text_email + '\n' +

       "Inquiry: " + text_message + '\n' +

       "'</script>"); 

最佳答案

尝试使用 Environment.NewLine 而不是 '\n'

关于c# - asp c# 基本mailto函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11634714/

相关文章:

c# - 如何获取指向 IShellView2 接口(interface)的指针

c# - ReSharper 能否生成将属性从一个对象复制到另一个对象的代码?

javascript - Canvas 内元素中的事件

asp.net - 创建 Web 应用程序以扫描文档

c# - 对于以 0x85 字符结尾的文件路径(Windows 8),.Net 4.6.1 和 4.6.2 之间的奇怪 Path.GetFullPath 行为不同

c# - EndpointNotFoundException - 404 - 通过 Visual Studio 在 IIS 中通过 HTTPS 托管 WCF 服务

c# - 无效操作异常 : Cannot create a DbSet for 'Role' because this type is not included in the model for the context

c# - 无法在 CentOS amd64 上执行二进制文件

javascript - 使用 Broadway.js 解码原始 h.264

Javascript:使用 RegEx 读取 android list 文件中的包