邮件链接共享点设计器

发布于 2024-07-15 08:52:14 字数 264 浏览 8 评论 0原文

在共享点设计器中,我有一个控件

<SharePointWebControls:TextField FieldName="Title" runat="server"></SharePointWebControls:TextField>

,我想要一个 mailto 链接 这将使用此标题作为电子邮件的主题,并且我需要电子邮件正文包含一些文本,例如“我的示例文本”,

我该怎么做?

谢谢

In sharepoint designer I have a control

<SharePointWebControls:TextField FieldName="Title" runat="server"></SharePointWebControls:TextField>

I want to have a mailto link
that will use this title as the subject of the email and i need the body of the email to contain some text e.g. "My Example Text"

how do i do this?

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

遮云壑 2024-07-22 08:52:14

在我看来,您正在寻找的不是 MailTo 链接,而是联系表单,可能类似于 这个示例 很有用,至少可以作为参考。 另外,此 Sharepoint 联系表单示例也值得一看。

It sounds to me as though, rather than a MailTo link you are looking for a contact form, perhaps something like this example would be useful, at least as something to look at. Also this Sharepoint contact form example could be worth a look.

安静 2024-07-22 08:52:14

我会使用上面给出的方法。
Jason 给出的评论具有误导性 - 该代码实际上是自定义字段控件。 是的,我猜自定义字段控件可以称为用户控件,因为它们是用 C# 编写的。
我在自己的解决方案中使用类似的自定义字段控件。

I would use the above given approach.
The comment Jason gave is misleading - that code is in fact a custom field control. And yes, I guess custom field controls could be called user controls, since they are written in C#.
I use similar custom field controls in my own solutions.

路弥 2024-07-22 08:52:14

我建议创建一个自定义字段类,它继承自 TextField 并在显示模式下创建 mailto 标记。

public class EmailToTextField: Microsoft.SharePoint.WebControls.TextField
{
    public override void RenderControl(System.Web.UI.HtmlTextWriter writer)
    {
     switch (ControlMode)
     {
        case Microsoft.SharePoint.WebControls.SPControlMode.Display:
              writer.Write("<a href='mailto:" + Value + "?subject=" + Value + "&body=sometext'>EMAIL</a>");
              break;
        default:
              base.RenderControl(writer);
              break;
      }
   }
}

然后只需将其添加为安全控件,并在如下代码中使用它:

<MyWebControls:EmailToTextField FieldName="Title" runat="server"></MyWebControls:EmailToTextField>

希望有帮助

I would suggest creating a custom field class, that inherits from TextField and in the display mode creates the mailto tag.

public class EmailToTextField: Microsoft.SharePoint.WebControls.TextField
{
    public override void RenderControl(System.Web.UI.HtmlTextWriter writer)
    {
     switch (ControlMode)
     {
        case Microsoft.SharePoint.WebControls.SPControlMode.Display:
              writer.Write("<a href='mailto:" + Value + "?subject=" + Value + "&body=sometext'>EMAIL</a>");
              break;
        default:
              base.RenderControl(writer);
              break;
      }
   }
}

And then just add it as a safe control, and use it in code like this:

<MyWebControls:EmailToTextField FieldName="Title" runat="server"></MyWebControls:EmailToTextField>

Hope it helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文