锚标记在事件接收器中不起作用
我创建了一个事件接收器,以便在添加项目时触发电子邮件。在此事件接收器中,电子邮件将发送给员工。在电子邮件内容中,我想提供一个链接,以便员工可以直接访问该网站。但在我的代码中我面临一些问题。这是我的代码
public string MailMsgBody_WU(string MailTo, SPItemEventProperties IERProperties)
{
string MMsgBody = "";
System.Diagnostics.Debug.WriteLine("Travel Request-MailMsgBody(): Begin");
try
{
MMsgBody += "<table>";
MMsgBody += "<tr><td>Hi,</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td> New Calendar Item Event" + IERProperties.ListTitle + " has been added into learning portal.</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td>Please click on the following link to view the details.</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td><a href=" + http://tri02sharepoint:47709/Lists/Learning%20Calendar/calendar.aspx + ">Click Here</a></td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td>Thanks,</td></tr>";
MMsgBody += "<tr><td>Learning Team</td></tr>";
MMsgBody += "</table>";
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Travel Request-MailMsgBody(): End" + ex.Message.ToString());
}
return MMsgBody;
}
,我收到错误MMsgBody += "点击此处< ;/td>";
http:// <---- 这里是错误
这些是错误
错误 1 无效的表达式术语“:”
错误2;预计
错误3;预计
I have created an event receiver to trigger an e-mail whenever an item was added.in this event receiver email gets deliverd to the employee. In the e-mail content i would like to give a link so that the employee can go to the web site directly. but in my code i am facing some problem . here is my code
public string MailMsgBody_WU(string MailTo, SPItemEventProperties IERProperties)
{
string MMsgBody = "";
System.Diagnostics.Debug.WriteLine("Travel Request-MailMsgBody(): Begin");
try
{
MMsgBody += "<table>";
MMsgBody += "<tr><td>Hi,</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td> New Calendar Item Event" + IERProperties.ListTitle + " has been added into learning portal.</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td>Please click on the following link to view the details.</td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td><a href=" + http://tri02sharepoint:47709/Lists/Learning%20Calendar/calendar.aspx + ">Click Here</a></td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td><br></br></td></tr>";
MMsgBody += "<tr><td>Thanks,</td></tr>";
MMsgBody += "<tr><td>Learning Team</td></tr>";
MMsgBody += "</table>";
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Travel Request-MailMsgBody(): End" + ex.Message.ToString());
}
return MMsgBody;
}
i am getting the error inMMsgBody += "<tr><td><a href=" + http://tri02sharepoint:47709/Lists/Learning%20Calendar/calendar.aspx + ">Click Here</a></td></tr>";
http:// <---- here is the Error
These are the errors
Error 1 Invalid expression term ':'
Error 2 ; expected
Error 3 ; expected
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能这样做:
你基本上是在尝试在 C# 代码中调用一个名为“http://tri02sharepoint...”的函数/字段/成员,而该函数显然不存在。
您应该这样做:
您需要转义 " 等特殊字符,并使用 \ 来实现。
You can't do this:
You are basically trying to call a function/field/member called "http://tri02sharepoint..." within your C# code, which obviously does not exist.
You should do this instead:
You need to escape special characters like " and you do that with a \.