小编Gon*_*ing的帖子

如何在SilverLight中的某个时间(500毫秒)调用某些方法

我有两种方法,例如Method1和Method2.在Method1完成后如何调用Method2 500ms?

 public void Method1()
 {

 }

 public void Method2()
 {

 }
Run Code Online (Sandbox Code Playgroud)

c# silverlight silverlight-3.0 silverlight-4.0

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

C#对象层次结构

我有一个单元格列表,每个列表都有一个站点列表.

有时我需要获得一个站的父细胞.

我该如何实现这种层次结构?

  • 我应该将父单元格保留为工作站对象中的属性吗?
  • 我应该只保留工作站对象中的父单元ID吗?
  • 做点什么不一样?

c# object

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

新的LOB Silverlight 4带棱镜4(mvvm,mef,unity)

我正在使用Silverlight v4和WCF Ria Services启动一个新的LOB应用程序.我们的想法是使用Prism v4,包括MVVM,MEF和Unity.

我可以将所有这些"技术"结合起来使用:可以设想哪种架构场景?

编写一个骨架来构建这种可以重用的应用程序是否有意义?也许已经作为样本申请存在?

(在Prism v4中有很多示例项目,但没有包含所有"技术"的项目)

提前致谢.

prism mef unity-container mvvm silverlight-4.0

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

为什么这个MVC异步操作失败?

我正在尝试使用异步控制器操作,以遵循典型身份AccountController代码的模式,但如果我直接访问该页面,则会出现以下错误(如果我在登录后通过重定向静默挂起):

The specified parameter type 'System.Threading.Tasks.Task`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not valid. Only scalar types, such as System.Int32, System.Decimal, System.DateTime, and System.Guid, are supported.
Parameter name: item 
  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.ArgumentOutOfRangeException: The specified parameter type 'System.Threading.Tasks.Task`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not valid. Only scalar types, such …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc razor async-await

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

我不明白$(this)jQuery对象是如何工作的

我正在学习jquery是如何工作的,到目前为止它还是很好,但是我被困在了$(this)对象上.以下是我不太了解的代码部分.

$(".photos").on("mouseenter", "li", function(){

$(this).closest(".photos").find("span").slideToggle();


});
Run Code Online (Sandbox Code Playgroud)

$(this)指的是与类照片($("照片"))的元素或李(一个或多个),这是在内部使用类照片中的元素?

javascript jquery

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

如何从ajax函数获取返回值到变量?

我正在调用一个函数,我希望得到一些价值.但我没有任何价值.

我该如何使用返回值?

$(function () {
    $(".datepicker").datepicker({
        beforeShowDay: function (date) {
            var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
            return [array.indexOf(string) == -1]
            console.log(array.indexOf(string) == -1);
        }
    });
});
var BDate = gateDateBooking(); // Calliing a function 
var BookingDate = Bdate; // But i did't get any responce here
function gateDateBooking(){
    $.ajax({
        url: "localhost/CodeIgniter_2.2.0/index.php/admin/GetBookingDate",
        type: "POST",
        dataType: "text",
        cache: false,
        success: function (data) {
           alert(data);
          return data; // return responce 
       }
   });
 }
Run Code Online (Sandbox Code Playgroud)

ajax jquery

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

MVC Razor 视图 - 货币格式

我正在使用剃刀语法。我有价值,例如 1123456 返回到我的观点。我想显示为$1,123,456 USD

我有以下行

@Model.TotalCost
Run Code Online (Sandbox Code Playgroud)

如何在其上应用字符串格式以显示 1,123,456 美元等值?

model-view-controller razor

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

父母与子女

我有两个级别列表

<ul>
   <li></li>
   <li></li>
   <li>
      <ol>
         <li></li>
         <li class="active"></li>
         <li></li>
      </ol>
   </li>
   <li></li>
   <li></li>
</ul>
Run Code Online (Sandbox Code Playgroud)

我如何使用内部LI活动类将新类添加到父LI中,如

 <ul>
      <li class="parent">
         <ol>
           <li class="active">
Run Code Online (Sandbox Code Playgroud)

jquery

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

为什么程序在没有try/catch的情况下失败?

我在发布配置中使用VS2010和C++

以下执行正常:

int status;
try
{
    status = myfunction(arg1, arg2);
}
catch (int e)
{
    cout << "An exception occurred. Exception Nr. " << e << endl;
}
Run Code Online (Sandbox Code Playgroud)

但是,以下程序崩溃了:

int status;
status = myfunction(arg1, arg2);
Run Code Online (Sandbox Code Playgroud)

发生了什么?
我没有方法的来源,myfunction,这是第三方dll的一部分.

c++ try-catch visual-studio-2010

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

jQuery只能在HTML文件中使用,而不能在JS文件中使用

我刚刚设置了jQuery(有点像jQuery脚本),但是当我想在我的.js文件中使用它时,它没有用.后来我尝试使用标签在我的HTML文件中使用jQuery,但之后就可以了!我想在我的.js文件中编写脚本,所以有人可以帮我这个吗?谢谢!

HTML文件:

<!DOCTYPE html>
<html>

<head>
    <title>Test</title>

    <script src="test.js" ></script>
    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>

</head>

<body>
    <script>
        alert("My current jQuery version is "+jQuery.fn.jquery);
    </script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Javascript文件:

alert("I am running this from 'test.js'. My current version of jQuery is "+jQuery.fn.jquery);
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

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