小编Irv*_*nin的帖子

为什么Html.ActionLink呈现"?Length = 4"

我非常困惑为什么这个代码

Html.ActionLink("About", "About", "Home", new { hidefocus = "hidefocus" })
Run Code Online (Sandbox Code Playgroud)

结果在这个链接:

<a hidefocus="hidefocus" href="/Home/About?Length=4">About</a>
Run Code Online (Sandbox Code Playgroud)

hidefocus部分是我的目标,但它?Length=4来自哪里?

asp.net-mvc

299
推荐指数
5
解决办法
9万
查看次数

如何转换DateTime?到DateTime

我想将一个可以为空的DateTime(DateTime?)转换为a DateTime,但是我收到一个错误:

无法隐式转换类型'System.DateTime?' 到'System.DateTime'.存在显式转换(您是否错过了演员?)

我尝试过以下方法:

DateTime UpdatedTime = (DateTime)_objHotelPackageOrder.UpdatedDate == null 
    ? DateTime.Now : _objHotelPackageOrder.UpdatedDate;
Run Code Online (Sandbox Code Playgroud)

.net c# datetime

156
推荐指数
7
解决办法
19万
查看次数

jQuery UI 1.10:dialog和zIndex选项

当图像点击时,我必须对apear进行对话.问题是我在那里有一些非常大的z-index(例如500),而ui对话框就在那些元素的背面.

这是页面,您需要登录,用户:"raducup"并传递:"1".另一个问题是,当我单击关闭对话框时,对象会消失.

这是我点击图像时调用的函数:

function openItem(obiect){
    $( obiect ).css('zIndex',9999);
    $( obiect ).dialog({
        dialogClass: "no-close",
        modal: true,
        draggable: true,
        overlay: "background-color: red; opacity: 0.5",
        buttons: [
            {
                text: "OK",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });
    reparaZindex();
}
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery jquery-ui

46
推荐指数
4
解决办法
9万
查看次数

如何在select2框架中使用占位符作为默认值

要获得select2我正在使用的所选值:

var x = $("#select").select2('data');
var select_choice = x.text
Run Code Online (Sandbox Code Playgroud)

问题是,如果没有选择值,则抛出错误,我想知道是否有任何方法使其返回占位符,如果没有选择选项

jquery jquery-selectors jquery-select2

42
推荐指数
5
解决办法
10万
查看次数

WCF错误:"X.509证书CN = localhost链构建失败..."

尝试让我的WCF客户端和服务器相互通信时,我收到此错误.

X.509证书CN = localhost链构建失败.使用的证书具有无法验证的信任链.替换证书或更改certificateValidationMode.已处理证书链,但终止于信任不信任的根证书.

如果我关闭SSL证书,一切都很完美.

wcf ssl-certificate

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

Bootstrap popover,隐藏在外面点击?

使用bootstrap popover,现在我试图让这个代码在popover外面点击以关闭popover:

$('body').on('click', function (e) {
    $('[data-toggle="popover"]').each(function () {
        //the 'is' for buttons that trigger popups
        //the 'has' for icons within a button that triggers a popup
        if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
            $(this).popover('hide');
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

但是,当我使用这个部分时,我可以关闭弹出窗口,但我不能点击其他按钮,任何人都知道我怎么能这样做?

所有按钮:

<a href="#" class="btn btn-xs btn-primary" data-toggle="popover">This opens popover</a>
<a href="#" class="btn btn-xs btn-primary">Other link</a> <- Doesn't work 
<a href="#" class="btn btn-xs btn-primary">Other link</a> <- Doesn't work 
Run Code Online (Sandbox Code Playgroud)

jquery twitter-bootstrap

21
推荐指数
4
解决办法
5万
查看次数

如何从bootstrap-markdown.js调用.getContent和.parseContent

在使用Bootstrap插件时我是新手(刚刚通过codecademy了解它)...我真的想使用这个很棒的bootstrap markdown插件但是无法正确安装它所以我可以从中调用getContent和parseContent textarea.

如果你能帮助我,我会非常感激它 - 很多!

到目前为止我已经完成了这个(从codecademy中嘲笑示例)

我想要的是:

最终目标

到目前为止我做了什么

下载了以下库(jquery,bootstrap,bootstrap-markdown,to-bootstrap,markdown通过亭子)和复制的这些文件到js/vendor文件夹

  • jquery.js (V2.1.1)
  • bootstrap.js (V3.1.1)
  • bootstrap-markdown.js (V2.5.0)
  • he.js (v0.4.1)
  • to-markdown.js (没有版本号)
  • markdown.js (没有版本号)

的index.html

<!doctype html>
<html>
  <head>
    <link href="css/bootstrap.css" rel="stylesheet">        
    <link href="css/bootstrap-markdown.min.css" rel="stylesheet">    

    <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
    <link href="css/style.css" rel="stylesheet">

    <script src="js/vendor/jquery.js"></script>
    <script src="js/vendor/bootstrap.js"></script>
    <script src="js/vendor/markdown.js"></script>
    <script src="js/vendor/bootstrap-markdown.js"></script>     
    <script src="js/vendor/he.js"></script>
    <script src="js/vendor/to-markdown.js"></script>



  </head>

  <body>

    <div class="container">

      <form>   
            <textarea name="content" data-provide="markdown-editable" rows="2" class="status-box md-input"_>### …
Run Code Online (Sandbox Code Playgroud)

css markdown twitter-bootstrap

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

Uncaught SyntaxError:在严格模式代码中,函数只能在顶层声明或在另一个函数中立即声明

你好,当我在开发者模式下运行这个项目时(grunt服务器)https://github.com/kennethlynne/generator-angular-xl一切正常但是当我在生产模式下运行它(grunt build)时我得到一个`

Uncaught SyntaxError:在严格模式代码中,函数只能在顶层声明或在另一个函数中立即声明

任何人都知道发生了什么事吗?谢谢,

PS.我发布了一个项目的链接而不是代码,因为JS在许多文件中被拆分.

javascript strict angularjs

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

IIS上发布时<serviceHostingEnvironment multipleSiteBindingsEnabled ="true"/>出错

我有一个测试wcf服务与默认方法和Web配置是:

 <system.web>
    <compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true"/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)

在本地IIS上,当我发布它时工作正常.但是当我尝试在远程IIS上发布时,我收到此错误:

描述:处理为此请求提供服务所需的配置文件时发生错误.请查看下面的具体错误详细信息并相应地修改配置文件.

分析器错误消息:在应用程序级别之外使用注册为allowDefinition ='MachineToApplication'的部分是错误的.此错误可能是由于未在IIS中将虚拟目录配置为应用程序引起的.

Line 23:       </service>
Line …
Run Code Online (Sandbox Code Playgroud)

iis wcf

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

带链接的jquery UI工具提示html

我想使用jquery UI工具提示.

在工具提示中,我希望html中会有一个链接.

我看到这篇文章(Jquery UI工具提示不支持html内容),说明如何在工具提示中使用html.

但是当我想在工具提示中添加链接时会出现问题.

当我带光标进入工具提示点击链接时,工具提示消失了(因为我从分配给工具提示的元素中鼠标输出.

我能做什么?

谢谢.

更新:

  $(function () {
      $(document).tooltip({
          content: function () {
              return $(this).prop('title');
          }
      });
  });
Run Code Online (Sandbox Code Playgroud)

示例:http://jsfiddle.net/jLkcs/

jquery jquery-ui tooltip

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