问题列表 - 第27334页

如何将焦点放在ASP.NET MVC页面上的JQuery Dialog按钮之一?

我有一个ASP.NET MVC页面(注册).在加载页面时,我在该对话框上使用" 同意"和" 不同意"按钮调用Jquery Dialog.

1).默认情况下如何将焦点设置为"同意"按钮

2).如何禁用右上角的X(关闭)标记?(因此我不希望用户简单地关闭该对话框).

码:

$("#dialog-confirm").dialog({
        closeOnEscape: false,
        autoOpen: <%= ViewData["autoOpen"] %>,
        height: 400,
        width: 550,
        modal: true,
        buttons: {
            'Disagree': function() {
                location.href = "/";
            },
            'Agree': function() {
                $(this).dialog('close');
                $(this).focus();
            }
        },
        beforeclose: function(event, ui) {
            var i = event.target.id;
            var j = 0;
        }
    });        
Run Code Online (Sandbox Code Playgroud)

感谢您的回复.

谢谢

asp.net-mvc jquery jquery-ui jquery-dialog asp.net-mvc-2

5
推荐指数
1
解决办法
7238
查看次数

为什么Scala中Array.map的定义是"throw new Error()"

的源代码map用于阵列是:

override def map[B](f: A => B): Array[B] = throw new Error()
Run Code Online (Sandbox Code Playgroud)

但以下工作:

val name : Array[String]= new Array(1)
name(0)="Oscar"
val x = name.map {  ( s: String ) => s.toUpperCase }
// returns: x: Array[java.lang.String] = Array(OSCAR)
Run Code Online (Sandbox Code Playgroud)

scala

9
推荐指数
1
解决办法
696
查看次数

同一个域名中最顶层的iframe是什么?

如何获得同一域中最顶层的iframe,即

iframe level 1 example.org
    iframe level 2 example.org
    iframe level 2 example.org 
        iframe level 3 example.org <-- should return iframe level 1

iframe level 1 other-example.org
    iframe level 2 example.org
    iframe level 2 example.org 
        iframe level 3 example.org <-- should return iframe level 2

iframe level 1 other-example.org
    iframe level 2 example.org
    iframe level 2 example.org <-- should return iframe level 2 (this)
Run Code Online (Sandbox Code Playgroud)

我需要它,因为我有一个网站应该在另一个域的iframe中工作并且独立.

在这个网站上有一些依赖于window.top的脚本,它不应该是顶层,而是同一域中最顶层的iframe.

javascript iframe

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

在什么情况下SqlConnection会自动登记在环境TransactionScope事务中?

SqlConnection在事务中"登记"是什么意思?它只是意味着我在连接上执行的命令将参与事务吗?

如果是这样,在什么情况下SqlConnection会自动登记在环境TransactionScope事务中?

查看代码注释中的问题.我对每个问题的答案的猜测都在括号中的每个问题之后.

场景1:在事务范围内打开连接

using (TransactionScope scope = new TransactionScope())
using (SqlConnection conn = ConnectToDB())
{   
    // Q1: Is connection automatically enlisted in transaction? (Yes?)
    //
    // Q2: If I open (and run commands on) a second connection now,
    // with an identical connection string,
    // what, if any, is the relationship of this second connection to the first?
    //
    // Q3: Will this second connection's automatic enlistment
    // in the current transaction scope cause the transaction to …
Run Code Online (Sandbox Code Playgroud)

c# ado.net sqlcommand sqlconnection transactionscope

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

如何从DropDownList获取最后一个选项值?

我有DropDownList以下选项:

o select
1 hot
2 cold
3 warm
Run Code Online (Sandbox Code Playgroud)

如何从中获取最后一个选项值("暖")DropDownList

c# drop-down-menu

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

何时使用strncpy或memmove?

(gcc 4.4.4 c89)

我一直习惯于strncpy复制字符串.我从来没有真正使用memmovememcpy非常.然而,当你决定是否要使用我只是想知道strncpy,memmovememcpy

我写的代码是针对客户端/服务器应用程序的.在他们使用的文档中bcopy.但是,我可以和其他人一样吗?

bcopy((char*)server->h_addr,
      (char*)&serv_addr.sin_addr.s_addr,
      server->h_length);
Run Code Online (Sandbox Code Playgroud)

非常感谢,

c string

17
推荐指数
4
解决办法
9834
查看次数

Verizon SongID - 如何编程?

对于不熟悉Verizon的SongID程序的人来说,它是一个可通过Verizon的VCast网络下载的免费应用程序.它会在歌曲中的任何一点听一首歌10秒钟,然后将这些数据发送给一些全知的算法兽,将其咀嚼起来并送回所有ID3标签(艺术家,专辑,歌曲等......)

前两部分和最后一部分是直截了当的,但在录制声音发送后的处理过程中会发生什么?

我认为它必须采取声音文件(什么格式?),解析它(如何?用什么?)一些关键标识符(这些是什么?波函数的常规属性?相位/移位/幅度/等),并检查它针对数据库.

我在网上找到的关于它是如何工作的一切都像我上面输入的一样通用.

来自audiotag.info

该服务基于先进的音频识别算法,结合了先进的音频指纹识别技术和大型歌曲数据库.上传音频文件时,音频引擎会对其进行分析.在分析期间,通过将音频"指纹"与音乐数据库进行比较来提取和识别其音频"指纹".在该识别过程完成时,在屏幕上显示关于具有匹配概率的歌曲的信息.

audio verizon-wireless audio-processing audio-analysis

6
推荐指数
1
解决办法
186
查看次数

C#基于Parent对象初始化子类

所以基本上我有这个

public class Ticket{
    public TicketNumber {get; set;}
    ..a bunch more properties...
}
Run Code Online (Sandbox Code Playgroud)

我想使用包含而不是使用包含这样的子类添加一些属性.

public class TicketViewModel(Ticket ticket){
    //set each property from value of Ticket passed in
    this.TicketNumber = ticket.TicketNumber;
    ...a bunch more lines of code..

    //additional VM properties
    public SelectList TicketTypes {get; private set;}
}
Run Code Online (Sandbox Code Playgroud)

如何实例化属性而不必像这样写所有行

this.TicketNumber = ticket.TicketNumber;
Run Code Online (Sandbox Code Playgroud)

有某种捷径吗?像子类构造函数中的东西?

this = ticket; 
Run Code Online (Sandbox Code Playgroud)

显然这不起作用但是它们是某种方式所以如果addng /删除属性到父类,我不必修改我的子类?或者其他的东西?

c# initialization subclass

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

宏观崩溃全部在解决方案visual studio 2010中

我在vs2005和vs2008中找到了适合我的CollapseAll宏.但是,这种方式在vs2010中有效.看起来它只折叠顶级节点而不是任何可以扩展的子节点?有任何想法吗?

谢谢,棒.

    Sub CollapseAll()
        ' Get the the Solution Explorer tree
        Dim UIHSolutionExplorer As UIHierarchy
        UIHSolutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object()
        ' Check if there is any open solution
        If (UIHSolutionExplorer.UIHierarchyItems.Count = 0) Then
            ' MsgBox("Nothing to collapse. You must have an open solution.")
            Return
        End If
        ' Get the top node (the name of the solution)
        Dim UIHSolutionRootNode As UIHierarchyItem
        UIHSolutionRootNode = UIHSolutionExplorer.UIHierarchyItems.Item(1)
        UIHSolutionRootNode.DTE.SuppressUI = True
        ' Collapse each project node
        Dim UIHItem As UIHierarchyItem
        For Each UIHItem In UIHSolutionRootNode.UIHierarchyItems
            'UIHItem.UIHierarchyItems.Expanded = …
Run Code Online (Sandbox Code Playgroud)

visual-studio-2010 visual-studio

4
推荐指数
1
解决办法
3020
查看次数

POST数据在大文件上传时消失

我的PHP应用程序中存在文件上载实用程序的问题.当在表单上发送大文件(9MB +)时,我得到了一个非常奇怪的行为:表格中包含的POST数据消失了,包括文件信息.

我已经增加了所有PHP限制(时间限制,最大输入时间,发布最大大小,内存限制和上传最大文件大小),但我仍然无法获得正确的行为.我尝试用基于Flash的解决方案(SWFUpload,www.swfupload.org)替换常规HTTP表单,仍然是相同的行为.

我尝试过多个类似大小的文件,绝对不是特定的文件问题.我已经调试了使用Firebug发送的POST变量,并且标题中仍然存在正确的变量以及文件.

这可能会发生什么?

html javascript php forms uploading

7
推荐指数
1
解决办法
1843
查看次数