我在代码中有一个非常奇怪的问题,我不希望它会失败。这是一个基于 AspDotNetStoreFront 的网站,有一些流量但不是那么大。尝试从读取器读取数据库字段时,站点间歇性崩溃。这发生在网站的不同地方。此类代码的示例在下面与object pValue = rs["PropertyValueString"]; 的行中。
private Dictionary<string, object> GetPropertValuePairs(string userName)
{
string query = string.Format("select PropertyName, PropertyValueString from dbo.profile with(nolock) where CustomerGUID = {0} and StoreID = {1}", DB.SQuote(userName),AppLogic.StoreID());
Dictionary<string, object> propertyValues = new Dictionary<string, object>();
using (SqlConnection conn = new SqlConnection(DB.GetDBConn()))
{
conn.Open();
using (IDataReader rs = DB.GetRS(query, conn))
{
while (rs.Read())
{
string pName = DB.RSField(rs, "PropertyName");
object pValue = rs["PropertyValueString"];
if (propertyValues.ContainsKey(pName) == false)
{
propertyValues.Add(pName, pValue);
}
}
rs.Close();
rs.Dispose();
}
conn.Close();
conn.Dispose(); …
Run Code Online (Sandbox Code Playgroud) 我有一个运行ASPDOTNETSTOREFRONT 的网上商店。
我正在尝试向一组网页添加自定义的跟踪脚本行。
为此,我将一个 Google 标签管理器脚本添加到这些页面使用的 XML 包中,以便它出现在我想要跟踪的所有页面上。
我只是将 Google Tag Manager 脚本复制并粘贴到我的 XML 包中。
`<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-5HD6WH"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5HD6WH');</script>
<!-- End Google Tag Manager -->`
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用这个包加载一个页面时,它给出了以下错误。
Exception=Error in XmlPackage(.Load), Package=[product.engineproduct.xml.config], Msg=[Exception=An error occurred while parsing EntityName. Line 246, position 42.
]
Run Code Online (Sandbox Code Playgroud)
所以人们可以看到行号和位置,我可以显示来自 XML 包(源代码)的屏幕截图。
http://i.stack.imgur.com/mJ2Tb.jpg
任何人有任何建议如何解决这个问题?
xml asp.net xml-parsing aspdotnetstorefront google-tag-manager
我正在使用AspDotNetStorefront(这就是为什么我必须使用xsl),我的客户希望能够对类别中的产品进行排序.我决定使用tablesorter并使用jsrender来渲染模板.
我可以创建一个特殊的链接,因为xsl正在为jsrender模板剥离我的花括号之一.
所以我有一个像/images/blah.jpg这样的带/ productImage的对象,以下工作正常.
<td>{{:productImage}}</td>
Run Code Online (Sandbox Code Playgroud)
太棒了 - 所以我试着加入一个链接:
<td><a href='{{:productImage}}'>See the image</a></td>
Run Code Online (Sandbox Code Playgroud)
并且xsl将我的模板输出为:
<td><a href='{:productImage}'>See the image</a></td>
Run Code Online (Sandbox Code Playgroud)
所以它没有正确呈现.我在过去的几个小时里尝试了各种各样的想法但却无法正常工作.如何让XSL不受我的花括号的影响?