2013-01-19 65 views
0

我在母版页中使用以下代码。VS 2012中的分析器错误

<link rel='stylesheet' id='layer-styles-css' 
    href='css/layerslider.css?ver=3.4.1' type='text/css' media='all' /> 

它给我的错误,而在MS Visual Studio中调试它2012年

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: 'layer-styles-css' is not a valid identifier. 

请帮我解决这个问题。

+0

添加id属性的原因是什么? – ChaosPandion

+0

你有任何控制'runat =“server”'包含链接? –

回答

1

当控件被标记为runat="server"时,它的idid及其所有包含的元素需要遵循与C#属性相同的命名约定。

我看不到您的HTML结构,但是如果您更改短划线-以强调_,它很可能会解决您的问题。