小编Zuh*_*aib的帖子

在IFrame之外移动ModalPopup.可能?

我的主页里面有一个iframe.iframe页面中有一个modalpopup.因此,当显示modalpopup时,modalpopup的父级是iframe主体和主页面父主体.因此,叠加层仅覆盖iframe而不是整个页面.

我尝试使用jQuery将modalpopup从iframe移动到父窗口body元素(或父窗体内的任何其他元素).我收到一个无效的参数错误.

如何从iframe中的页面显示modalpopup,它应该覆盖整个文档,父文档?

更新:

由于很少有用户对实现相同的行为感兴趣.这里是解决方法

我建议的最好的解决方法是在主页面中使用modalpopup ..然后从iframe调用它..说这样的东西..

/* function in the main(parent) page */
var _onMyModalPopupHide = null;
function pageLoad(){
    // would be called by ScriptManager when page loads
    // add the callback that will be called when the modalpopup is closed
    $find('MyModalPopupBehaviorID').add_hidden(onMyModalPopupHide);
}
// will be invoked from the iframe to show the popup
function ShowMyModalPopup(callback) {
    _onMyModalPopupHide = callback;
    $find('MyModalPopupBehaviorID').show();
}
/* this function would be called when the modal popup is closed */
function onMyModalPopupHide(){
    if (typeof(_onMyModalPopupHide) …
Run Code Online (Sandbox Code Playgroud)

asp.net iframe modalpopupextender

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

线程和SqlFileStream.该进程无法访问指定的文件,因为它已在另一个事务中打开

我正在提取SQL文件表中的文件的内容.如果我不使用Parallel,以下代码可以正常工作.

我同时读取sql文件流(并行)时遇到以下异常.

该进程无法访问指定的文件,因为它已在另一个事务中打开.

TL; DR:

在Parallel.ForEach中从FileTable读取文件(使用GET_FILESTREAM_TRANSACTION_CONTEXT)时,我得到了上述异常.

示例代码供您试用:

https://gist.github.com/NerdPad/6d9b399f2f5f5e5c6519

更长版本:

获取附件,并提取内容:

var documents = new List<ExtractedContent>();
using (var ts = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
    var attachments = await dao.GetAttachmentsAsync();

    // Extract the content simultaneously
    // documents = attachments.ToDbDocuments().ToList(); // This works
    Parallel.ForEach(attachments, a => documents.Add(a.ToDbDocument())); // this doesn't

    ts.Complete();
}
Run Code Online (Sandbox Code Playgroud)

DAO读取文件表:

public async Task<IEnumerable<SearchAttachment>> GetAttachmentsAsync()
{
    try
    {
        var commandStr = "....";

        IEnumerable<SearchAttachment> attachments = null;
        using (var connection = new SqlConnection(this.DatabaseContext.Database.Connection.ConnectionString))
        using (var command = new SqlCommand(commandStr, connection))
        {
            connection.Open();

            using …
Run Code Online (Sandbox Code Playgroud)

c# multithreading sql-server-2008 parallel.foreach sqlfilestream

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

为少数控件启用ViewState,为其他/页面启用禁用

当我为页面禁用ViewState时.它不允许任何其他控件使用ViewState ..即使我为该特定控件设置EnableViewState ="true"..

是否可以在为页面本身禁用ViewState时为控件启用ViewState?

如果不是如何禁用viewstate页面上的控件,除了少数没有明确指定EnableViewState ="false"..键入相同的这么多控件是忙乱..

c# asp.net viewstate

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

脚本调试不起作用(VS 2008)

我最近在安装VS 2008后安装了VS 6.0并覆盖了JIT设置..当我启动VS 2008选项对话框时...它说另一个调试器已经接管了VS 2008调试器并且我让我重置..所以我做了..

现在一切正常,除了javascript调试.我无法调试javascript ..我可以设置断点..但在调试模式下,当我悬停断点时,它说"断点当前不会被命中.文件未加载"..

我该如何解决这个问题?我可以重置JIT设置吗?

javascript debugging jit visual-studio-2008

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

浮动左边100%高度div - div之间的间隙

标记

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Zuhaib.test" %>
<!-- Put IE into quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="css/general.css" rel="stylesheet" type="text/css" />
    <link href="css/outbound.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server" class="wrapper">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="left">
    </div>
    <div id="right">
    </div>  
    </form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

CSS

html, body
{
    margin:0;
    padding:0;
    border:0;
    overflow:hidden;
    width:100%;
    height:100%;
}
* html body 
{
    height:100%;
    width:100%;
}    
*{
    margin:0;
    padding:0;
} …
Run Code Online (Sandbox Code Playgroud)

html css css-float

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

什么!!:2在Bash意味着什么?

我正在观看这个视频教程,在1:40左右,作者发出以下命令.它在最近创建的文件夹下创建了两个文件.

touch !!:2/{package.json,index.js}
Run Code Online (Sandbox Code Playgroud)

有人可以解释一下是什么!!:2意思?为什么它没有在所有文件夹下创建两个文件?

bash

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

这个简单的Log4Net包装可以改进吗?

我写了一个简单的log4net包装器.我想知道这个包装器代码是否可以改进.

我有点担心每个日志功能(信息,警告等)中引入的反射代码以获取调用函数名称.是否因此存在任何可能的性能问题?

namespace Acqueon.Pacer.Core.Helpers
{
    #region Imports

    using System;
    using System.Diagnostics;
    using System.Reflection;

    using log4net;

    #endregion

    /// <summary>
    /// log4net Log helper
    /// </summary>
    public sealed class Logger
    {
        #region Constants and Fields

        /// <summary>
        /// Determines whether the DEBUG Mode is enabled.
        /// </summary>
        private readonly bool isDebugEnabled;

        /// <summary>
        /// The is error enabled.
        /// </summary>
        private readonly bool isErrorEnabled;

        /// <summary>
        /// Determines whether the FATAL Mode is enabled.
        /// </summary>
        private readonly bool isFatalEnabled;

        /// <summary> …
Run Code Online (Sandbox Code Playgroud)

.net c# log4net

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

Backbone.js模型验证不起作用

以下代码有什么问题?

(function(){

    window.App = {
        Models: {},
        Collections: {},
        Views: {}
    };

    window.template = function(id) {
        return _.template($('#' + id).html());
    };

    App.Models.Task = Backbone.Model.extend({
        defaults:{
            title: '',
            priority: 0
        },

        validate: function(attrs, options){
            if (attrs.priority < 0){
                return 'Priority cannot be negative.';
            }
        }
    });

    var task = new App.Models.Task ({ title: 'Sample Task', priority: 5 });
    task.on('invalid', function(model, error) { console.log(error); })

    task.save({ priority: -9 }); // Should not pass validation
    console.log(task.validationError); // Prints a validation error

    console.log(task.toJSON()); // …
Run Code Online (Sandbox Code Playgroud)

model-validation backbone.js

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