小编Kob*_*obi的帖子

Jquery表单submit()回调不起作用

我有一个iframe和一个表单.表格的目标是iframe.当我提交表单时,结果页面应该加载到iframe中.我附上了以下代码:

<html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
 <script type="text/javascript">

 function submitForm() {
 $("form#testForm").submit(function(){
   alert('hii')
  });
}
</script>

</head>

<body>

<iframe name="testFrame" id="testFrame" frameborder="1" scrolling="no" width="500"     height="200"></iframe>
<form name="testForm" id="testForm" action="http://www.yahoo.com" target="testFrame">    </form>

<button name="testBtn" value="submit" onclick="submitForm();">submit</button>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

警报没有来......请帮帮我...

jquery

3
推荐指数
1
解决办法
9307
查看次数

SharePoint - CustomAction未在工具栏上显示内容类型

我创建了一个内容类型的功能:

<ContentType ID="0x01007C963A8770A24bbfBDBCE157B96EE769"
             Name="Send" Group="Demo" Version="1">
</ContentType>
Run Code Online (Sandbox Code Playgroud)

我想为此内容类型创建自定义操作.
适用于ECB(每个项目标题的弹出菜单):

<CustomAction
    Id="Demo.Send.PopupMenu"
    Title="Send"
    Location="EditControlBlock"
    Description="Hold"
    RegistrationType="ContentType"
    RegistrationId="0x01007C963A8770A24bbfBDBCE157B96EE769">
      <UrlAction Url="http://www.google.com/search?q={ItemId} Cookies"/>
</CustomAction>
Run Code Online (Sandbox Code Playgroud)

但是,我不能让它在表单的工具栏上工作(编辑或显示):

<CustomAction
    Id="Demo.Send.DisplayFormToolbar"
    Title="Send"
    Location="DisplayFormToolbar"
    Description="Send"
    RegistrationType="ContentType"
    RegistrationId="0x01007C963A8770A24bbfBDBCE157B96EE769"
    Sequence="108">
       <UrlAction Url="http://www.google.com/search?q={ItemId} Cookies"/>
</CustomAction>
Run Code Online (Sandbox Code Playgroud)

我没有收到任何错误消息,我只是看不到按钮.
工作,如果我改变了RegistrationId0x01,但后来我看到它在所有内容类型(所有项目,真的).

知道这段代码有什么问题吗?

sharepoint custom-action sharepoint-2007 sharepoint-feature

3
推荐指数
1
解决办法
1916
查看次数

如何在C#命令中使用LIKE运算符?

我需要在Sql命令中插入一个字符串

search.CommandText = "SELECT * FROM Contacts WHERE Name like ' + @person + % + '";
Run Code Online (Sandbox Code Playgroud)

什么是LIKE在命令中使用的正确方法?

c# sql sql-like

3
推荐指数
1
解决办法
3万
查看次数

无法将类型'System.Collections.Generic.List <System.Collections.Generic.IEnumerable <xxx >>'隐式转换为'System.Collections.Generic.List <xxx>

我收到以下错误.我用Google搜索了一天多,但我找不到确切的解决方案,请帮帮我谢谢

错误:无法隐式转换 System.Collections.Generic.List<System.Collections.Generic.IEnumerable<ADCO.eJMC.EntityDataModel.ShareholderUser>>System.Collections.Generic.List<ADCO.eJMC.EntityDataModel.ShareholderUser>

我使用了以下代码

List<ShareholderUser> list = new List<ShareholderUser>();
list = dataContext.EJMCShareholderApprovals
                  .Include(s => s.Shareholder.ShareholderUsers)
                  .Where(e => e.EJMCRequestId == requestId)
                  .Select(s => s.Shareholder.ShareholderUsers
                                .Where(x => x.AccessMode == true))
                  .ToList();
Run Code Online (Sandbox Code Playgroud)

c# entity-framework

3
推荐指数
1
解决办法
1912
查看次数

使用<pre>标记时,文本超出父<asp:label>边框

我有一个奇怪的问题,

我有一个datarepeater从数据库中读取一些用户条目,然后在<asp:label>...中显示它们

我的第一个问题是,当阅读文本时,所有内容都\n被删除了..

所以我用一个<pre>标签来解决这个问题..然而......出现了一个新问题..现在文本实际上超出了标签的边界..

<td width="630px" >
 <pre>
   <asp:Label ID="lblComments"  runat="Server" 
       width="630px" Text='<%#DataBinder.Eval(Container.DataItem, "Comments") %>'
       Style="font-size: larger">
   </asp:Label>
  </pre>
</td>
Run Code Online (Sandbox Code Playgroud)

html css asp.net

2
推荐指数
1
解决办法
2925
查看次数

f.readline()的问题?

我一次从文件中读取一行,但在每行的末尾添加一行'\n'.

示例:
文件有:094 234 hii
但我的输入是:094 234 hii\n

我想逐行阅读,但我不需要保留换行符......

我的目标是从每一行读取一个列表:我需要['094','234','hii'],而不是['094','234','hii\n'].

有什么建议?

python file-io

2
推荐指数
2
解决办法
813
查看次数

>>,<<,|的含义 和&在JavaScript中

我正在使用base64编码脚本,但它在JSLint中抛出了很多警告.

有人能告诉我这些符号在JavaScript中的含义是什么吗?

>>,<<,|,&

以下是包含这些符号的代码示例:

if ((c > 127) && (c < 2048)) {
    utftext += String.fromCharCode((c >> 6) | 192);
    utftext += String.fromCharCode((c & 63) | 128);
}
Run Code Online (Sandbox Code Playgroud)

我想重写它,以便它由JSLint验证.

javascript

2
推荐指数
1
解决办法
1004
查看次数

将HTML标记的内容与Javascript RegEx匹配

我在JavaScript函数中将以下HTML作为字符串:

<p>one</p> <p align='center'>two</p>
Run Code Online (Sandbox Code Playgroud)

我想提取这个字符串:

"onetwo" (显然没有引号)

你能否建议一些纯JavaScript代码(jQuery也可以...)来获取标签的内容?

html javascript regex tags jquery

2
推荐指数
1
解决办法
2111
查看次数

LInq中的Sum(ABS(col))

Linq中实体的以下SQL的替代方法是什么?我正在使用EF 4.1在Asp.Net MVC 3中创建LINQ查询:

SELECT Sum(ABS([Installment])) AS SumOfPayments FROM tblSchoolAccount 
Run Code Online (Sandbox Code Playgroud)

linq linq-to-entities entity-framework-4

2
推荐指数
1
解决办法
5613
查看次数

如何循环并比较两个文本文件中的数百万个值?

我有两个文本文件文件(TXT),其中包含超过200万个不同的文件名.我想遍历第一个文件中的所有名称,并找到第二个文本文件中也存在的名称.

我试过循环,StreamReader但需要花费很多时间.我也尝试了下面的代码,但它仍然需要太多时间.

StreamReader first = new StreamReader(path);
string strFirst = first.ReadToEnd();
string[] strarrFirst = strFirst.Split('\n');

 bool found = false;

StreamReader second = new StreamReader(path2);
string str = second.ReadToEnd();
string[] strarrSecond = str.Split('\n');

for (int j = 0; j < (strarrFirst.Length); j++)
{
          found = false;

    for (int i = 0; i < (strarrSecond .Length); i++)
    {
        if (strarrFirst[j] == strarrSecond[i])
        {
            found = true;
            break;
        }
    }

    if (!found)
    {
        Console.WriteLine(strarrFirst[j]);
    }
}
Run Code Online (Sandbox Code Playgroud)

有什么比较文件的好方法?

c# arrays performance loops data-structures

2
推荐指数
1
解决办法
1571
查看次数