Last post Nov 17, 2005 01:52 PM by Eilon
Oct 07, 2005 06:00 PM|schallm|LINK
Oct 27, 2005 10:37 PM|Shazam999|LINK
Oct 28, 2005 10:04 AM|schallm|LINK
I realize that. But if intellisense knows that it is required, why can't the ASP.Net parser know that it is required and assume that as the default.
Oct 28, 2005 11:41 AM|Shazam999|LINK
Nov 16, 2005 11:11 AM|Eilon|LINK
Nov 16, 2005 11:48 AM|schallm|LINK
Nov 17, 2005 01:52 PM|Eilon|LINK
Don't worry, dead horses have no feelings :)
The runat="server" attribute is used at runtime as well by the ASP.net parser. Visual Studio does look at that attribute to help make its determination about what's a control and what's not. If it has runat="server" then it's a server control, and can be
access in code-behind via its ID. If you have a tag that says <asp:DeadHorse id="foo" /> and you actually have a control called DeadHorse in the "asp" tag prefix, it won't actually work because everyone just assumes you didn't really want a control like that.
The assumption is that you were just writing some bizarrely odd XHTML and it gets ignored. Now, this is where IntelliSense actually shows its brains and
doesn't ignore it. It sees the <asp:DeadHorse and it says "wait a sec, I'm pretty sure that's a control, even though there's no runat=server yet" so it offers you the runat attribute, as well as all the other properties on the DeadHorse control. Nevertheless,
no one actually knows that it's a control until you've put the runat=server on the tag.
I hope this helps explain it a bit further.