看小提琴:
这在Chrome/FF中运行良好,但在Internet Explorer中,它在Jquery文件中出错:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Wed, 16 Feb 2011 23:59:13 UTC
Message: Unexpected call to method or property access.
Line: 16
Char: 55207
Code: 0
URI: https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js
Run Code Online (Sandbox Code Playgroud) string message = CommonFunctions.SanitiseInput(context.Request.QueryString["msg"]);
Run Code Online (Sandbox Code Playgroud)
功能定义为:
// Sanitise input
public static string SanitiseInput(string inputText)
{
string cleanedString = inputText;
cleanedString.Replace("<","<"); // No code
cleanedString.Replace(">", ">");
cleanedString.Replace("&", "&"); // No query string breaks
return cleanedString;
}
Run Code Online (Sandbox Code Playgroud)
给定输入,"<b>rg</b>"返回相同,而不是"<b>rg</b>"

在这种布局中,它无效,因为H1不是第一个渲染的头部元素......这是一个可怕的罪恶还是没关系?有任何解决这个问题的方法吗?两列都是可变长度的,所以我看不到任何方式.
引文
有人让我引用这个:
http://www.w3.org/WAI/ER/IG/ert/ert-19991221.html#Technique3.5.A
应检查标题元素(H1-H6)以确保它们根据以下规则嵌套.文档中的第一个标题元素必须为H1文档中必须只有一个H1元素标题级别不得增加超过1个级别.示例:H1之后的H2是好的.H1之后的H3很糟糕.标题元素可以减少任何级别.示例:H5之后的H2可以.
只是试验Linq:
DataClassesDataContext db = new DataClassesDataContext();
var q = from p in db.tblBlogEntries select p;
foreach (var customer in q)
{
Response.Write(customer.ID + " " + customer.title + "\n");
}
Run Code Online (Sandbox Code Playgroud)
工作正常,但我似乎只能返回1个字段,或者所有字段.我如何选择说,p.ID而且p.title,没有别的?
我来自经典的ASP,我做了:
myVar = request.querystring("ID")
response.redirect("lol.asp");
Run Code Online (Sandbox Code Playgroud)
在.net中它是:
myVar = Request.Querystring["ID"];
Response.Redirect("lol.aspx");
Run Code Online (Sandbox Code Playgroud)
方括号何时用于圆形方括号?它们意味着什么?我现在有点理解它代表一个索引?
3个具有相同功能的示例:
使用大括号
public static int TicketsRequiringSupportResponse()
{
int ReturnValue = 0;
using (var dc = new CrystalCommon.MainContext())
{
ReturnValue = (dc.tblHelpCentreQuestions.Where(c => c.awaitingSupportResponse == true).Count());
}
return ReturnValue;
}
Run Code Online (Sandbox Code Playgroud)
使用没有大括号
public static int TicketsRequiringSupportResponse()
{
int ReturnValue = 0;
using (var dc = new CrystalCommon.MainContext())
ReturnValue = (dc.tblHelpCentreQuestions.Where(c => c.awaitingSupportResponse == true).Count());
return ReturnValue;
}
Run Code Online (Sandbox Code Playgroud)
没有大括号,并在使用区块内返回
public static int TicketsRequiringSupportResponse()
{
using (var dc = new CrystalCommon.MainContext())
return (dc.tblHelpCentreQuestions.Where(c => c.awaitingSupportResponse == true).Count());
}
Run Code Online (Sandbox Code Playgroud)
所有这些都妥善处理吗?方法3是最好的,代码最少,但我担心它不能正确处理,因为return语句会中断.
我已经搜索但无法找到如何做到这一点.我正在尝试使用comment-modbox内部this隐藏和显示元素:
$('.comment-wrapper').each(function (index) {
$(this, '.comment-modbox').mouseover(function () {
$('.comment-modbox').show();
});
$(this, '.comment-modbox').mouseout(function () {
$('.comment-modbox').hide();
});
});
Run Code Online (Sandbox Code Playgroud)
此代码隐藏并显示所有内容,comment-modbox无论它们是否包含在内this.
谢谢你的帮助!
$('.comment-wrapper').each(function (index) {
$(this).mouseover(function () {
$('.comment-modbox', this).show();
});
$(this).mouseout(function () {
$('.comment-modbox', this).hide();
});
});
Run Code Online (Sandbox Code Playgroud) 我在命名空间中定义了一个类:
namespace Artworking
{
public class Category
{
int ID {get;set;}
string Name {get;set;}
public Category(int ID, string Name)
{
this.ID = ID;
this.Name = Name;
}
public Category(int ID)
{
using (CrystalCommon.MainContext db = new CrystalCommon.MainContext())
{
var q = (from c in db.tblArtworkTemplateCategories where c.ID == ID select c).SingleOrDefault();
this.ID = q.ID;
this.Name = q.CatName;
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
在我的内容页面上,我从另一个函数中获取所有类别,并添加一个列表框控件:
// Category select
Artworking.Category[] Cats = Artworking.CommonFunctions.FetchAllCategories(Master.LoggedInUser.Client.ID);
foreach(Artworking.Category C in Cats){
ListItem NewItem = new ListItem();
NewItem.Text = …Run Code Online (Sandbox Code Playgroud) 我不确定这是否是正确的做事方式,看起来很长,我想检查这是将linq结果转换为类的好方法:
/// <summary>
/// A job header
/// </summary>
public class JobHeader
{
public int ID { get; set; }
public int? UserID { get; set; }
public int? ClientID { get; set; }
public string JobName { get; set; }
public string Code { get; set; }
public DateTime? DateAdded { get; set; }
public int? StatusID { get; set; }
public bool UniversalQuantity { get; set; }
public bool UniversalDelivery { get; set; }
public bool UniversalDeliveryDates { …Run Code Online (Sandbox Code Playgroud) 这很好用:
var q = (from c in db.tblLiteCategorySpecs where CategoryIDs.Contains(c.CategoryID) select c.SpecID).Distinct().ToList();
var qq = (from s in db.tblSpecifications where q.Contains(s.id) select s);
Run Code Online (Sandbox Code Playgroud)
但是我现在需要在第一个查询中返回另一个字段:
var q = (from c in db.tblLiteCategorySpecs where CategoryIDs.Contains(c.CategoryID) select new { c.SpecID, c.FriendlyName }).Distinct().ToList();
var qq = (from s in db.tblSpecifications where q.Contains(s.id) select s);
Run Code Online (Sandbox Code Playgroud)
所以q.contains现在失败了,我需要以某种方式处理q查询SpecID字段.有人知道怎么做吗?