易元 2012-01-11 16:00
4 for(int i=1;i<names.Count;i++)
5 {
6 if(names.Item(i)!=null)
7 ServerList.Items.Add(names.Item(i));
8 }
博主,为什么从第一个开始取呢?
assassin0905 2012-01-10 11:44
楼主 我输出的是NuN 这是怎么回事?
Slp415 2011-12-28 21:37
那就序列化,,
Slp415 2011-12-28 21:29
? 没有了?
wuli8129 2011-12-05 10:23
楼主,你好。我用控制台程序是可以运行以上代码,可是用sp的EventHandler调用的时候就会报错,在生成Application的时候报COM组件错误,还请指点。
啊風 2011-09-30 16:54
猛拽会不会卡?
北极星泪 2011-08-12 11:48
非常感谢楼主和楼上的,刚好用上......
sdxd.bgl 2011-06-23 11:19
好CodeSnipet,我稍微改造了下!
public static class SPListItemExtension
{
public bool IsCurrentInField(this SPListItem item, string field)
{
SPWeb web = item.ParentList.ParentWeb;
SPFieldUser uField = item.Fields[field] as SPFieldUser;
if (!uField.AllowMultipleValues) //允许多重选择
{
SPFieldUserValue userValue = new SPFieldUserValue(web, item[field].ToString());
return IsCurrentUserInSPFieldUserValue(web, userValue);
}
else
{
SPFieldUserValueCollection userValues = item[field] as SPFieldUserValueCollection;
foreach (SPFieldUserValue userValue in userValues)
{
if (IsCurrentUserInSPFieldUserValue(web, userValue))
{
return true;
}
}
}
return false;
}
private static bool IsCurrentUserInSPFieldUserValue(SPWeb web, SPFieldUserValue userValue)
{
if (userValue.User != null)
{
return userValue.User.LoginName == web.CurrentUser.LoginName;
}
else
{
SPGroup group = web.Groups.GetByID(userValue.LookupId);
return group.ContainsCurrentUser;
}
}
}
john23.net 2011-04-14 21:09
不错
酱板猪 2011-03-22 09:22
正好做这块内容。
谢谢阿
john23.net 2011-03-16 13:25
学习了
clound 2011-03-16 13:00
哪有那么麻烦,其实就是通过setInterval,利用ajax保存到数据。
腾格里 2010-11-24 18:02
上面为一篇SharePoint中的"用户或用户组"栏,内容很相近,有没有可以综合的地方?
腾格里 2010-11-24 18:00
http://iamlishuchao.blog.51cto.com/1189601/271853
McJeremy&Fan 2010-09-28 14:47
[quote]DrkBreeze's Bolg:这个我也遇到过,在编写一个省市区无刷新的三级联动下拉框控件的时候我也遇到过这个问题,也是用的ICallbackEventHandler接口,后面两个下拉框必须等到一个下拉框有返回值后才能执行,但JS里没法阻塞,用了两种办法,1.SetTimeout 执行(延时长短不好设置,和网络有关系的)。 2.设置全局标识,取到值后在响应(比较死且且笨拙的办法)。 但这两个办法都不是什么好的办法。看了楼主提的问题,看能不能 JQuery AJAX 剥离出来,变成一个可以开发控件的接口。[/quote]
我最终放弃了使用这个接口,因为MSDN中也很明确的说不支持多个的同步.
最后还是使用原生的js ajax来调用了.
DrkBreeze's Bolg 2010-09-28 13:42
这个我也遇到过,在编写一个省市区无刷新的三级联动下拉框控件的时候我也遇到过这个问题,也是用的ICallbackEventHandler接口,后面两个下拉框必须等到一个下拉框有返回值后才能执行,但JS里没法阻塞,用了两种办法,1.SetTimeout 执行(延时长短不好设置,和网络有关系的)。 2.设置全局标识,取到值后在响应(比较死且且笨拙的办法)。 但这两个办法都不是什么好的办法。看了楼主提的问题,看能不能 JQuery AJAX 剥离出来,变成一个可以开发控件的接口。
McJeremy&Fan 2010-08-18 11:29
[quote]陈晨:
','+name+',' like '%,111,%'
好恐怖的效率问题[/quote]
唉,还是我经验少的缘故啊..当时使用这种clob的时候,是由于项目数据量不可能多,所以并没发现这个问题...
陈晨 2010-08-17 18:25
','+name+',' like '%,111,%'
好恐怖的效率问题
Loro 2010-07-24 10:40
请问为什么按模板生成了,但是#foreach等标记也一起生成进去了?
fangxianjuner 2010-07-20 10:15
Server Error in '/oa' Application.
--------------------------------------------------------------------------------
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005.
kaneboy 2010-07-05 12:06
SPContext.Current.IsDesignTime
keyapril 2010-06-23 13:34
[quote]IT鸟:跨域哦。呵呵[/quote]
closed属性在跨域的时候也是可以用的。
IT鸟 2010-06-23 13:17
跨域哦。呵呵
keyapril 2010-06-23 10:51
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> a.html </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script>
function aClick(e) {
var __srcElm = e.srcElement ? e.srcElement : e.target;
var win = window.open(__srcElm.href);
var __interval = window.setInterval(function() { if (win.closed) { window.clearInterval(__interval); document.getElementById('btnParent').click(0); } }, 100);
if (e.preventDefault) {
e.preventDefault();
}
else {
e.returnValue = false;
}
return false;
}
</script>
</head>
<body>
<input type="button" id="btnParent" onclick="alert('a');" value="Click !" />
<a onclick="aClick(event)" href="http://www.cnblogs.com" target="_blank">Link to B.HTML</a>
</body>
</html>
卡索 2010-06-22 19:23
这个问题很衰,相信很难做出好的解决...
McJeremy&Fan 2010-06-22 18:10
[quote]Pandora:难道用JS监控a的click事件,然后替换为window.open,然后轮询window对象就这么难吗?[/quote]
我也尝试这样去处理,但是如果访问的是其它域的页面,就会有权限问题。
Pandora 2010-06-22 17:41
难道用JS监控a的click事件,然后替换为window.open,然后轮询window对象就这么难吗?
BearRui(AK-47) 2010-06-22 15:17
如果一定要这样做,就把<a href="" 改成用window.open打开,这样至少可以获取到1个window对象.然后看这个window对象能否做一些监控之类的。
蓝蓝的天 2010-06-22 14:54
确实有难度, 期待高手··
小任哦 2010-06-22 14:32
不错,发现博客园后,不用参加什么培训班了,通过在博客园学习,我建立了自己的第一个网站:[url=http://www.seo368.com/]http://www.seo368.com/[/url]
我给你传答案 2010-06-22 13:21
应该不可以吧..或者把目标页面载入一个div里..在做控制?
kuibono 2010-06-22 13:15
只能通过iframe或者window.open来完成,同时还要docoment.domain='同一个域名';
passer.net 2010-06-22 12:46
@南院那
在IE8 FireFox3 下通过测试
其它未知
南院那 2010-06-22 12:10
[quote]passer.net:
[url=http://www.dajieju.net/demo.html]http://www.dajieju.net/demo.html[/url]
有点意思 firefox下测试通过
监听是不可能的
不过写个计时器倒是可以[/quote]
只能本地
行: 5
错误: 拒绝访问。
yy870926 2010-06-22 11:57
关注中。。。
阿K&LiveCai 2010-06-22 11:36
-_-!
passer.net 2010-06-22 11:24
[url=http://www.dajieju.net/demo.html]http://www.dajieju.net/demo.html[/url]
有点意思 firefox下测试通过
监听是不可能的
不过写个计时器倒是可以
zhangle 2010-06-22 11:13
链接到其他网站然后关闭后还要反馈给你,没有想到解决的办法.如果谁有解决的办法告诉我一下
博客园团队 2010-06-22 10:52
建议在博问(http://space.cnblogs.com/q/)中提问。
另外,标题是不是有文字写错了?
咔嚓 2010-06-22 10:50
做不到这样的效果,都不是 一个域了,浏览器安全也会阻止
wuxiaoqqqq 2010-06-22 10:25
浏览器的安全会阻止你这么做的。
木鱼 2010-06-22 10:07
这个应该是办不到的吧(个人猜测),否则百度的结果点击应该就更好统计了——打开的窗口关闭自动调用事件统计?哦也。
jifsu 2010-06-22 10:04
@南院那
人家的页面不允许被放在iframe呢?
此帖要火?
mr.ayo 2010-06-22 10:03
我有一个比较笨的思路。
你看能否把a.html中的 btnParent 的点击事件 js方法体 放到b.html中去处理。 并且在A链接至b.html的时候通过queryString的方式传值过去让b.html在关闭的时候触发然后来处理
南院那 2010-06-22 10:00
3楼的回复是什么意思?
我突然 有个很弯的想法。
打开的是我们的页面。里面 用IFRAME 来 载别人的页面。
就先不费心思去想怎么跨了。
icjyw.com 2010-06-22 09:56
思路不错
jifsu 2010-06-22 09:54
应用场景是什么...凭空想象出来的需求?还是说需求,不要说自己的解决方式
舞千愁 2010-06-22 09:36
这问题不好解决啊。。本身就不是同一个域了。。还要监听事件。。
如果你解决了,你发我邮箱一份,谢谢, admin@661z.com
McJeremy&Fan 2010-06-21 09:01
[quote]Adam Viki:
不知道您的问题有没有解决,我的觉得你的注册好像和我的不一样,你可以试试 这个
//注册Js的参数,成功回调函数,失败回调函数,是否异步
String cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context", "ReceiveErrorData", true);
//定义调用的主函数
String callbackScript = "function Speaker(arg, context)" + "{ " + cbReference + ";}";
//注册主函数
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Speaker", callbackScript, true);[/quote]
--
和我的注册一样的撒。
我遇到的问题是,.NET的异步不支持2个及以上的回调。
我已经放弃用这个接口,改用JQuery AJAX了。
Adam Viki 2010-06-20 08:35
不知道您的问题有没有解决,我的觉得你的注册好像和我的不一样,你可以试试 这个
//注册Js的参数,成功回调函数,失败回调函数,是否异步
String cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context", "ReceiveErrorData", true);
//定义调用的主函数
String callbackScript = "function Speaker(arg, context)" + "{ " + cbReference + ";}";
//注册主函数
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Speaker", callbackScript, true);