Sharepoint 弹出消息提示框
来源:互联网 发布:淘宝返利怎么设置 编辑:程序博客网 时间:2024/05/10 20:44
在event receiver中如何弹出一个类似winform中messagebox.show 的框?
1.
如果是在ItemAdding或者其他进行时(ing)事件里面,可以使用HttpContext.Current.Response.Write("<script>alert('aaaa');</script>");
如果是在ItemAdded或者其他结束后(ed)事件里面,那就没招。因为这类事件是异步的,已经获取不到页面的HttpResponse。
2.
可以在event reciver 里控制转向错误页面。
http://www.c-sharpcorner.com/Blogs/4224/sharepoint-2010-event-handler-redirection-to-custom-error-pa.aspx
properties.Status = SPEventRecieverStatus.CancelWithRedirectUrl;
Properties.RedirectUrl = “/_layouts/MyBlog/CustomError.aspx"
public override void ItemAdding(SPItemEventProperties properties)
{
base.ItemAdding(properties);
string tite = properties.AfterProperties[“title”].ToString();
if(tite.Contains(“_”))
{
properties.Cancel = true;
properties.Status = SPEventRecieverStatus.CancelWithRedirectUrl;
Properties.RedirectUrl = “/_layouts/MyBlog/CustomError.aspx?errormessage =Inavlid
Title”;
}
}
3.
Create a application page called customerror.aspx and show the error message from the query string
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="Server">
<asp:Label ID="lblError" runat="server" > </asp:Label>
</asp:Content>
4.
Add the following code in the page load
protected void
Page_Load(object sender EventArgs e)
{
lblError.Text = Request.Param[“Error”];
}
5.
function openAnswerQandADialog() {
var options = {
url: "/_layouts/QandA_PersonalAnswer.aspx",
width: 600,
height: 480,
title: "个人QandA"
};
SP.UI.ModalDialog.showModalDialog(options);
}
用js调用这个函数吧,这个是sharepoint自己带的函数,使用请在webpart中引用sharepoint命名控件啊。
- Sharepoint 弹出消息提示框
- sharepoint 消息提示框
- javascript弹出消息提示框
- C#弹出消息提示框方法
- 用PHP实现弹出消息提示框
- JOptionPane java 弹出对话框 消息提示框
- 弹出提示消息层
- 仿QQ弹出消息提示
- 做及时 提示 弹出消息
- 自动弹出一个消息提示
- Sharepoint 消息提示栏的使用
- 右下脚弹出的提示框用来提醒用户消息
- 制作从屏幕右下角逐渐弹出的消息提示框
- 页面上弹出“消息提示框”的aspx
- 页面上弹出“消息提示框”的cs
- 资源整合: 从托盘弹出Html消息提示框
- PHP 弹出消息提示框的两种方法
- 自动弹出网页右下角消息提示框特效
- 2011.9.26 多云
- windows live messenger 2009登录失败,提示“错误代码:81000605”的一个解决办法
- C++ [ 共享数据保护 ]
- 如何优化代码节约系统资源解决重复实例化对象的问题——神奇的单例模式(C#设计模式)
- Android-MMS中彩信附件的格式及分析
- Sharepoint 弹出消息提示框
- QT编写中碰到:找不到批处理文件
- Android之Toast的用法
- log4j 配置
- 学习重要,还是经营人脉重要?(转自李笑来)
- Javascript的Defer属性
- [转]Ultra Fractal教程系列49——动画功能的使用07——颜色渐变动画
- CSDN博文精选:Android系列开发博客资源汇总
- XMind – 免费好用的开源思维导图制作编辑软件 (支持Windows/Mac/Linux)