小编Mar*_*tín的帖子

在Bootstrap 3.0中使用缩略图的旋转木马

我需要制作Bootstrap 3.0 Carousel以显示缩略图幻灯片.我怎样才能做到这一点?这是我正在寻找的图像:

Bootstrap 3.0 Carousel Thumbs

这是Bootstrap 2的一个工作示例,但我需要这个用于Bootstrap 3.0:Bootstrap Thumbnail Slider

slider thumbnails carousel twitter-bootstrap twitter-bootstrap-3

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

无法找到程序集"Microsoft.SqlServer.Types"版本10或更高版本

我有个问题.我无法将迁移添加到我的ASP.NET WebAPI 2项目中.我收到错误:

"此提供程序无法使用空间类型和函数,因为无法找到程序集"Microsoft.SqlServer.Types"版本10或更高版本."

我知道有几个问题和答案,如:

但!问题是...

  • 我已经安装了Microsoft.SqlServer.Types.
  • 我已经将Global.asax配置为:SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("〜/ bin"))到Application_Start中.
  • 参考设置为本地副本> true.
  • NuGet包都已更新.
  • 我已经尝试降级并升级包.

当我尝试运行Add-Migration v002时,这是完整的错误:

System.InvalidOperationException:此提供程序无法使用空间类型和函数,因为无法找到程序集"Microsoft.SqlServer.Types"版本10或更高版本.
zh_cn System.Data.Entity.SqlServer.SqlTypesAssemblyLoader.GetSqlTypesAssembly()zh_cn System.Data.Entity.SqlServer.SqlSpatialServices.GeographyFromText(String wellKnownText)zh_cn System.Data.Entity.Spatial.DbGeography.FromText(String wellKnownText)zh_cn System.Data .Entity.Migrations.Model.ColumnModel.CreateDefaultValue()
zh_cn System.Data.Entity.Migrations.Model.ColumnModel..ctor(PrimitiveTypeKind type,TypeUsage typeUsage)zh_cn System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.BuildColumnModel(EdmProperty) property,TypeUsage conceptualTypeUsage,TypeUsage defaultStoreTypeUsage,IDictionary 2 annotations) en System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.BuildColumnModel(EdmProperty property, ModelMetadata modelMetadata, IDictionary2 annotations)
en System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.<> c__DisplayClass2e3.b__2df(EdmProperty p)en System.Data.Entity.Utilities.IEnumerableExtensions.Each [T]( IEnumerable 1 ts, Action1 action)en System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.BuildCreateTableOperation(EntitySet entitySet,ModelMetadata modelMetadata)zh_cn System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.b__194(EntitySet es)en System.Linq.Enumerable.WhereSelectEnumerableIterator 1..ctor(IEnumerable 1 source)zh_cn System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(ModelMetadata source,ModelMetadata target,Lazy 1 modificationCommandTreeGenerator,MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion,String targetModelVersion)zh_cn System.Data.Entity.Migrations.DbMigrator.Scaffold(String migrationName,String …

c# sql-server entity-framework azure visual-studio

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

带有Bootstrap 3.0的导航栏中的多个折叠按钮

我正在使用Bootstrap 3.0来显示带有一些链接和搜索字段的导航栏.当我转到"移动版"时,我有一个折叠导航栏并显示所有内容的按钮:链接和搜索字段.现在我需要两个按钮,一个只折叠导航栏的链接,另一个按钮只折叠搜索字段.我该怎么做?

collapse navbar responsive-design twitter-bootstrap twitter-bootstrap-3

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

手动将yyyy-MM-ddTHH:mm:ss.fffZ转换为JavaScript中的DateTime

我从Webservice收到一个字符串,其格式为以下格式:

yyyy-MM-ddTHH:mm:ss.fffZ
Run Code Online (Sandbox Code Playgroud)

我需要将使用JavaScript的String转换为普通的DateTime但不使用new,Date('yyyy-MM-ddTHH:mm:ss.fffZ')因为我使用的是不支持该转换的旧版JavaScript.我可以拆分该字符串并得到:

  • 时间

但如何操纵时区"fffZ"任何建议?

javascript datetime string-formatting nsdateformatter

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

在ASP.NET One Core中更新声明值

我在MVC 6(Asp.Net One Core)中有一个Web应用程序,我正在使用基于声明的身份验证.在Login方法中,我设置了声明:

var claims = new Claim[]
{
    new Claim("Name", content.Name),
    new Claim("Email", content.Email),
    new Claim("RoleId", content.RoleId.ToString()),
};

var ci = new ClaimsIdentity(claims, "password");
await HttpContext.Authentication.SignInAsync("Cookies", new ClaimsPrincipal(ci));
Run Code Online (Sandbox Code Playgroud)

现在,如果用户例如更改了用户配置文件中的电子邮件,我该如何更改"电子邮件"声明的电子邮件值?为了更新cookie,我必须再次使用SignOutAsync和SignInAsync吗?最好的解决方案是将其保存到经典会话中吗?还有更好的解决方案吗?我完全错了?

有什么建议?

c# asp.net asp.net-mvc claims-based-identity asp.net-identity-3

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

从c#中的WebApi OData(EF)响应中排除属性

我正在使用C#中的WebApi项目(EF代码优先),我正在使用OData.我有一个"用户"模型,包含Id,Name,LastName,Email和Password.

在控制器例如我有这个代码:

// GET: odata/Users
[EnableQuery]
public IQueryable<User> GetUsers()
{
    return db.Users;
}
Run Code Online (Sandbox Code Playgroud)

如果我调用/ odata/Users,我将获得所有数据:Id,Name,LastName,Email和Password.

如何从结果中排除密码,但在控制器中保持可用以进行Linq查询?

c# linq entity-framework odata asp.net-web-api

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

在JavaScript中按字符拆分但不是连续的

情况如下:

var stringExample = "hello=goodbye==hello";
var parts = stringExample.split("=");
Run Code Online (Sandbox Code Playgroud)

输出:

hello,goodbye,,hello
Run Code Online (Sandbox Code Playgroud)

我需要这个输出:

hello,goodbye==hello
Run Code Online (Sandbox Code Playgroud)

必须忽略连续/重复的字符,只需将单个字符"="拆分即可.

也许一些正则表达式?

javascript regex string split contiguous

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

使Bootstrap 3.0 NavBar内容始终崩溃

我需要让Bootstrap 3.0 NavBar的一部分总是崩溃.

导航栏的实际部分:

  • 链接
  • 搜索表格
  • 登录表格

当我在手机中打开网站时,我看到三个部分已折叠,我有三个图标可以折叠每个内容.

当我在PC中打开页面时,我看到栏中的三个部分可见(不是要折叠的按钮).我需要的?在PC视图中,只隐藏登录表单并显示折叠该登录表单的按钮.无论分辨率如何,我都需要让登录按钮始终可见,并且该部分已折叠.这是我的实际代码:

<nav class="navbar navbar-inverse" role="navigation">
    <div class="navbar-header">
        <!--Toggles -->
        <button type="button" class="navbar-toggle boton" 
                data-toggle="collapse" data-target="#sesion">
            <span class="glyphicon glyphicon-user"></span>
        </button>
        <button type="button" class="navbar-toggle boton"
                data-toggle="collapse" data-target="#links" id="menuToggle">
            <span class="glyphicon glyphicon-align-justify"></span>
        </button>
        <button type="button" class="navbar-toggle boton" 
                data-toggle="collapse" data-target="#buscar">
            <span class="glyphicon glyphicon-search"></span>
        </button>
        <!--Logo en vista Mobile -->
        <a class="navbar-brand" style="padding: 10px 0 0 15px" href="#">
            <span class="visible-xs">
                <img src="img/nsnow.png" width="37" height="36" alt="Logo" />
            </span>
        </a>
    </div>

    <ul class="collapse navbar-collapse nav navbar-nav" id="links">
        <!--Links --> …
Run Code Online (Sandbox Code Playgroud)

toggle collapse navbar twitter-bootstrap

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

角度材料2远程自动完成.如何中止请求?

我正在使用Angular Material Autocomplete来根据对远程API的搜索列出结果(过滤在远程端完成).

HTML方面:

<mat-form-field class="full-width">
    <input type="text" placeholder="Brand" aria-label="Number"
        matInput [formControl]="formControl" [matAutocomplete]="auto">
    <mat-autocomplete #auto="matAutocomplete">
        <mat-option *ngFor="let brand of brands | async" [value]="brand.name">
            {{ brand.name }}
        </mat-option>
    </mat-autocomplete>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)

TS方面:

this.brands = this.formControl.valueChanges.flatMap(
    q => this._apiService.getVehiclesBrands(q).map(x => x.results)
);
Run Code Online (Sandbox Code Playgroud)

此时,这工作正常.我从远程获取品牌列表,我可以从自动完成列表中选择一个值.现在的问题是......每次输入文本发生变化时,如何中止所有请求?

远程请求有很多例子,但想法不是在init上获取所有远程结果.我们的想法是每次用户更改文本输入时都会获得远程结果.

rxjs angular-material angular

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

MVC4实体框架 - 无法隐式转换

我使用模型中的Entity Framework 5创建了一个数据库.这个模型有一个名为'Person'的表,另一个叫做'Administrator'.'管理员'继承自'人'.

  • '人'有一个Id和一个名字.
  • "管理员"有代码.

在为"管理员"创建新的Controller时使用MVC4.当我自动创建控制器和视图时,这是错误:

错误2 - 无法在"Model.Administrator"中隐式转换类型"Model.Person".存在显式转换(您是否错过了演员?).

错误代码(在ASTERISKS之间):

public ActionResult Details(int id = 0)
    {
        **Administrator admin = db.Person.Single(u => u.Id == id);**
        if (admin == null)
        {
            return HttpNotFound();
        }
        return View(admin);
    }
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc entity-framework visual-studio asp.net-mvc-4

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