有没有办法删除某个角色后的所有内容,或者只选择该角色的所有内容?我从href获得了值,直到"?",它总是会有不同数量的字符.
像这样
/Controller/Action?id=11112&value=4444
Run Code Online (Sandbox Code Playgroud)
我希望href /Controller/Action只是,所以我想删除"?"之后的所有内容.
我现在正在使用它:
$('.Delete').click(function (e) {
e.preventDefault();
var id = $(this).parents('tr:first').attr('id');
var url = $(this).attr('href');
console.log(url);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在使用灯箱时禁用父级的html/body滚动条.这里的主要词是禁用.我也没有想隐藏它overflow: hidden;.
这样做的原因是overflow: hidden使网站跳转并占据滚动区域.
我想知道是否可以在显示时禁用滚动条.
我总是使用Repository模式但是对于我的最新项目,我想看看我是否可以完善它的使用和我的"工作单元"的实现.我开始挖的越多,我开始问自己一个问题:"我真的需要它吗?"
现在这一切都从Stackoverflow上的一些评论开始,跟踪Ayende Rahien在他的博客上的帖子,其中有2个具体,
这可能是永远和永远讨论的,它取决于不同的应用程序.我想知道什么
使用扩展方法很容易做到这一点.干净,简单,可重复使用.
public static IEnumerable GetAll(
this ISession instance, Expression<Func<T, bool>> where) where T : class
{
return instance.QueryOver().Where(where).List();
}
Run Code Online (Sandbox Code Playgroud)
使用这种方法和NinjectDI,我是否需要创建Context一个接口并将其注入我的控制器?
architecture aop design-patterns entity-framework repository-pattern
我对此持续了2天的努力,而没有更接近解决方案.我已阅读20-30个线程的alteast和stil无法解决此问题.
请帮帮我.
我已禁用匿名身份验证,启用asp.net模拟.
我已经添加了 <identity impersonate = "true" />
我已将用户添加到连接到我尝试连接的数据库的安全登录
这是我使用的连接字符串:
Data Source=IPTOSERVER;Initial Catalog=Phaeton;User Id=User;Password=Password;
Run Code Online (Sandbox Code Playgroud)
错误信息:
无法打开登录请求的数据库"Phaeton.mdf".登录失败.
用户'NT AUTHORITY\NETWORK SERVICE'登录失败.
如何从内部的添加HTML页面if()中@foreach().我得到没有任何具体的错误它只是没有采取第二个if().它像文字一样写出来.
这是我尝试但没有运气
@foreach (var item in Model)
{
if (count % 4 == 0 || totaltCount == 1)
{
<div class="in-instructor-container">
}
<div class="in-instructor">
<h3>@item.Name</h3>
@item.Information
</div>
if ((count - 1) % 3 == 0 || count == totaltCount) {
</div>
}
count++;
}
Run Code Online (Sandbox Code Playgroud)
我的HTML就是这样的
<div class="in-instructor-container">
}
<div class="in-instructor">
<h3>Test Person 0</h3>
bla bla bla bla bla bla bla
</div>
if ((count - 1) % 3 == 0 || count == totaltCount) { …Run Code Online (Sandbox Code Playgroud) 编辑:这只发生在具有存储库的大型项目中.有没有人使用EF4和CodeFirst方法并使用存储库?请建议我.
你好.我目前正在使用EF4 CodeFirst Classes.在我的测试项目中,我有两个类,作者和书(作者得到书).我正在尝试做的是我在我的作者类中有一个AddBook,但似乎不能像我不能将它添加到集合中..这里是我的类和两个不同的例外.
public class Book
{
public virtual int BookId { get; set; }
public virtual string Title { get; set; }
public virtual Author Author { get; set; }
}
public class Author
{
public virtual int AuthorId { get; set; }
public virtual string Name { get; set; }
public virtual ICollection<Book> Books { get; set; }
public Author()
{
Books = new Collection<Book>();
}
public void AddBook(Book book)
{
book.Author = this;
Books.Add(book);
}
} …Run Code Online (Sandbox Code Playgroud) entity-framework code-first entity-framework-4 asp.net-mvc-2
我想调暗页面并显示加载指示器.我得到了jQuery集.这是我无法工作的CSS.这是我不能做的背景.有任何想法吗?
这就是我得到的(在页面中央显示指标):
#Loading
{
display: none;
position: fixed;
z-index: 1000;
height: 31px;
width: 60px;
left: 50%;
top: 35%;
background-image: url('../Images/ajax-loader-bright.gif');
background-repeat: no-repeat;
}
Run Code Online (Sandbox Code Playgroud) 我不知道如何做到这一点.我想要做的是根据复选框值隐藏div.这是我的切换代码.
感谢任何帮助
.always是复选框
$(document).ready(function () {
$('.always').click(function () {
$('#dates').toggle();
});
});
Run Code Online (Sandbox Code Playgroud) 我试图trigger('blur');收集输入,但我似乎没有这样做.
例子可以在这里找到http://jsfiddle.net/VUUme/1/
我得到了收集,我得到了模糊方法,但我不确定触发器部分.
var $inputs = $('#form').find('input');
alert('load');
$inputs.each(function(){
$(this).trigger('blur');
});
//i tried this to but with no success
//$inputs.trigger('blur');
alert('after the blur');
$inputs.blur(function(){
var $this = $(this);
if ($this.val() == ''){
alert('it works');
}
});
Run Code Online (Sandbox Code Playgroud) jquery ×5
css ×2
javascript ×2
aop ×1
architecture ×1
asp.net ×1
code-first ×1
css3 ×1
forms ×1
html ×1
iis-7 ×1
web-config ×1