我正在使用Bootstrap Slider,我想知道是否有任何方法可以包含值更改的处理程序.我看到文档包括slideStart,slide和slideStop的处理程序,但没有"change"(值).
它们可能会滑动滑块并(在释放时)结束相同的值,在这种情况下我不希望事件触发.只有当他们将其滑动到新值时.
我试过了:
$('#sliderAdminType').slider({
formater: function(value) {
// my formater stuff that works
},
change: function(event, ui) {
console.log("has changed");
}
});
Run Code Online (Sandbox Code Playgroud)
和
$('#sliderAdminType').change(function() {
console.log("has changed");
});
Run Code Online (Sandbox Code Playgroud)
和
$('#sliderAdminType').slider().change(function() {
console.log("has changed");
});
Run Code Online (Sandbox Code Playgroud)
和
$('body').on('change', '#sliderAdminType', function(e){
console.log("has changed");
});
Run Code Online (Sandbox Code Playgroud) 我正在运行 .NET 3.5 和 IIS7。
我试图使用 customErrors 重定向到一个仍然可以显示异常详细信息、堆栈跟踪等的自定义错误页面。我很难让它工作,尝试了我在网上找到的大约 20 种不同的方法(主要是在 stackoverflow 上),其中一些是其他人的轻微变化。我更喜欢在 Web.config 中进行重定向,因为我希望在代码之外轻松找到/编辑自定义错误页面。
这就是我最终开始工作的内容。我发帖是因为我尝试了很多在这里找到的更复杂的方法,但它们对我不起作用,我只想发布最终成功的简单方法。
网页配置:
<customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite" />
Run Code Online (Sandbox Code Playgroud)
没有redirectMode="ResponseRewrite",我无法从我的自定义错误页面访问异常详细信息。
错误.aspx
protected void Page_Load(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex != null)
{
if (ex.GetBaseException() != null) ex = ex.GetBaseException();
litErrorMessage.Text = String.Format("<div class=\"error\">{0}</div>", ex.Message);
litErrorStackTrace.Text = String.Format("<b>Source:</b>\n{0}\n<b>Stack Trace:</b>\n{1}\n", ex.Source, ex.StackTrace);
}
else
{
litErrorStackTrace.Text = "No Exception information available.";
}
}
Run Code Online (Sandbox Code Playgroud)
我也尝试使用
HttpException ex = (HttpException)HttpContext.Current.Server.GetLastError();,如某些示例中所见,但这不起作用。
我还尝试了Global.asax -> Application_Error …