Visual Studio不能让我在使用aspx.vb制作的aspx页面上定义样式atrribute

时间:2022-04-23 02:47:36

I have made a aspx page with .aspx.vb codebase and it's not make me able to do define style attribute by typing. I am not able to type anything in style attribute.

我已经使用.aspx.vb代码库创建了一个aspx页面,并且它不能让我通过键入来定义样式属性。我无法在样式属性中键入任何内容。

is this bug in Vs12 ( I got it also in VWD)

是Vs12中的这个错误(我也是在VWD中得到的)

  <asp:Label runat="server" id="Label26" Text="Positions" style="width:200px;"></asp:Label>

I can't edit this when I have style=""; If I restart then I can edit and after sometime it's same problem again.

当我有style =“”时,我无法编辑这个;如果我重新启动然后我可以编辑,并在一段时间后再次出现同样的问题。


I means I can't type anything in style attribute, it's look like block. When I closed my visual studio and open again I can type but after sometime It's same issue.

我的意思是我不能在style属性中输入任何内容,它看起来像块。当我关闭我的视觉工作室并再次打开时,我可以输入但是过了一段时间它也是同样的问题。

I don't thing it's my problem. I have test same thing in my VWD and VS 12 PRO on Win8 PRO.

我不认为这是我的问题。我在我的VWD和Win8 PRO的VS 12 PRO上测试过同样的东西。

If I can run this code and it's worked then why I can't do that. if this is not recommanded then why it's work after a IDE restart.

如果我可以运行此代码并且它有效,那么为什么我不能这样做。如果不建议这样做,那么为什么它在IDE重启后才能工作。

@option. Please read it again, I have this problem with my both VWD12 and VS12 PRO.

@选项。请再次阅读,我的VWD12和VS12 PRO都有这个问题。

Can someone help me to get it worked for me. It's look like a bug in Visual studio. Someone can check this on their IDE with .aspx and aspx.vb file.

有人可以帮助我让它为我工作。它看起来像Visual Studio中的一个错误。有人可以使用.aspx和aspx.vb文件在IDE上查看。

Somebody know for now how to get it done for me.

有人现在知道如何为我完成它。

1 个解决方案

#1


0  

style is not an attribute of the ASP.net's Label control. It works just for compatibility, but I don't suggest you to use it this way. It's better to use CssClass and define all in Css.

style不是ASP.net的Label控件的属性。它仅用于兼容性,但我不建议您以这种方式使用它。最好使用CssClass并在Css中定义所有内容。

Anyway, if you want to add a style from codebehind:

无论如何,如果你想从codebehind添加一个样式:

Label26.Attributes.Add("style", "width: 200px;")

#1


0  

style is not an attribute of the ASP.net's Label control. It works just for compatibility, but I don't suggest you to use it this way. It's better to use CssClass and define all in Css.

style不是ASP.net的Label控件的属性。它仅用于兼容性,但我不建议您以这种方式使用它。最好使用CssClass并在Css中定义所有内容。

Anyway, if you want to add a style from codebehind:

无论如何,如果你想从codebehind添加一个样式:

Label26.Attributes.Add("style", "width: 200px;")