我有一个div class ='messages'.我通过jQuery.append()向这个div添加日期以下是样式:
.messages {
border: 1px solid #dddddd;
padding:10px;
height: 400px;
overflow-x:visible;
overflow-y: scroll;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
margin-bottom:10px;
font-size:14px;
}
Run Code Online (Sandbox Code Playgroud)
对于autoscroll我使用这样的功能:
receiveMessage = function (name, message, type) {
//adding new message
$("#messages").append('<strong>' + name + ": " + '</strong>' + message + '<br>');
/autoscrolling to the bottom
$("#messages").animate({
scrollTop: $("#messages").height()
}, 300);
}
Run Code Online (Sandbox Code Playgroud)
大约有20条消息正常滚动,但在"挂起"后,新消息不会滚动.Chrome版本19.0.1084.56.我做错了什么?谢谢!
我想在我的网站上手动实现基于表单的身份验证.
我正在使用Web.config文件进行数据存储
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx"
name=".ASPXAUTH"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="~/Admin/OrderHistory.aspx"
cookieless="UseDeviceProfile"
enableCrossAppRedirects="false"
>
<credentials passwordFormat="Clear">
<user name="Admin" password="adm123$"/>
<user name="Administrator" password="adm234%"/>
</credentials>
</forms>
</authentication>
<authorization>
<deny users ="?" />
<allow users = "*" />
</authorization>
Run Code Online (Sandbox Code Playgroud)
Login.aspx在根目录中有一个页面使用ASP.NET登录控件来获取用户名和密码.
一切正常,但当用户logged in手动转到login.aspx页面时,它不会将用户重定向到defaultUrl页面.
我想将用户重定向到特定页面/ defaultUrl页面,如果他已登录并手动登录到login.aspx页面
怎么做?
if (FormsAuthentication.Authenticate(LoginUser.UserName, LoginUser.Password))
{
FormsAuthentication.RedirectFromLoginPage(LoginUser.UserName, true);
}
Run Code Online (Sandbox Code Playgroud) 在PHP中,我可以像这样向数组添加一个值:
array[]=1;
array[]=2;
Run Code Online (Sandbox Code Playgroud)
并且输出将是 0=>'1', 1=>'2';
如果我在javascript中尝试相同的代码,它将返回Uncaught SyntaxError:Unexpected string.那么,JS中有没有什么方法可以像PHP一样工作?谢谢
所以我有这个Checkboxlist,我想为其中的元素实现Select All功能.我将它放在UpdatePanel中,但每次单击一个项目时,都会重新加载整个页面.这是我的代码:
<asp:UpdatePanel ID="CBLPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<div class="LeftAligned">
<asp:Label ID="FilterLabel" runat="server" Text="Filter by:" />
<asp:DropDownList runat="server" ID="FilterDDL" AutoPostBack="true" OnSelectedIndexChanged="FilterDDL_SelectedIndexChanged" />
<asp:ImageButton ID="FB" runat="server" ImageUrl="~/images/filter.png" AlternateText="VALUE"
CssClass="filter_button" OnClick="FB_Click" />
<div onmouseout="javascript:bMouseOver=false;" onmouseover="javascript:bMouseOver=true;"
class="filter_div">
<asp:CheckBoxList AutoPostBack="true" ID="FilterCheckBoxList" ClientIDMode="Static"
runat="server" CssClass="filter_checklist collapsed" OnSelectedIndexChanged="FilterCheckBoxList_Selected">
</asp:CheckBoxList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
我虽然我应该将ChildrenAsTriggers设置为false,这样我只会从代码更新,但它似乎不起作用.
var amount="0";
@String.Format("{0:0.00}", amount)
Run Code Online (Sandbox Code Playgroud)
回报 "0"
虽然我期待它回来
"0.00"
Run Code Online (Sandbox Code Playgroud) 一定有什么不对劲.我不知道是什么?在jsfiddle看到这个.
/*
$("p").live("click", function(){
$(this).after("<p>Another paragraph!</p>");
});
*/
$("p").on("click", function(){
$(this).after("<p>Now Click Me...Another paragraph!</p>");
});
Run Code Online (Sandbox Code Playgroud)
我选择了jquery 1.7.2.并且live工作正常但on不附加click事件.根据jquery文档,on应该按照live已弃用的方式工作.任何的想法?
asp.net ×2
c# ×2
javascript ×2
jquery ×2
arrays ×1
checkboxlist ×1
css ×1
php ×1
postback ×1
scroll ×1
scrolltop ×1
updatepanel ×1