joe_pool_is Posted March 17, 2009 Posted March 17, 2009 Are the following lines comments or exectuable code in an ASP.NET file? <!-- #include file='~/imageswap.html' --> <!--<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/About/BrucesBrew.aspx"><asp:Image ID="WhatsBrewingPhoto" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPhoto01.jpg" BorderWidth="0" /></asp:HyperLink> --> <%--<asp:Image ID="WhatsBrewingLS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingLeftSpacer.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingPrevious" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPrevious.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingNext" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingNext.gif" BorderWidth="0" /><asp:Image ID="WhatsBrewingRS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingRightSpacer.gif" BorderWidth="0" /><br />--%> I'm supposed to be fixing this ASP.NET site that someone else built and we don't have the project for it. But I honestly don't know that much about the technology. Quote Avoid Sears Home Improvement
Administrators PlausiblyDamp Posted March 17, 2009 Administrators Posted March 17, 2009 is including the file ~/imageswap.html into the current file and is not a comment while I think the other two lines are comments :confused: If you delete each of those lines in turn does it break anything? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Fork501 Posted April 2, 2009 Posted April 2, 2009 Are the following lines comments or exectuable code in an ASP.NET file? <!-- #include file='~/imageswap.html' --> <!--<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/About/BrucesBrew.aspx"><asp:Image ID="WhatsBrewingPhoto" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPhoto01.jpg" BorderWidth="0" /></asp:HyperLink> --> <%--<asp:Image ID="WhatsBrewingLS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingLeftSpacer.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingPrevious" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPrevious.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingNext" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingNext.gif" BorderWidth="0" /><asp:Image ID="WhatsBrewingRS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingRightSpacer.gif" BorderWidth="0" /><br />--%> I'm supposed to be fixing this ASP.NET site that someone else built and we don't have the project for it. But I honestly don't know that much about the technology. I know this is a semi-old thread (sort of), but I wanted to answer it, so others aren't confused. <!-- #include file='~/imageswap.html' --> This line will include a file for you. Since there's a tilde (~) and the beginning, it will start at the root and go through the directory structure to your location. So this is looking for imageswap.html in the root of the website. <!--<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/About/BrucesBrew.aspx"><asp:Image ID="WhatsBrewingPhoto" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPhoto01.jpg" BorderWidth="0" /></asp:HyperLink> --> This line will process your ASP.NET object (in this case, two HyperLinks and an Image) but when it processes it, it will be placed in a comment block and be invisible to the visitor. Viewing the source of the page will still yield HTML code associated with this. <%--<asp:Image ID="WhatsBrewingLS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingLeftSpacer.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingPrevious" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPrevious.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingNext" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingNext.gif" BorderWidth="0" /><asp:Image ID="WhatsBrewingRS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingRightSpacer.gif" BorderWidth="0" /><br />--%> Finally, this line will COMPLETELY ignore any code. I don't even think it's processed on the server's end. Since HTML is client-side, ASP.NET objects are processed before being displayed, so <%-- --%> is to ASP.NET as <!-- --> is to HTML. I hope this helps! ~Derek Quote Check out my blog! DevPaper.NET
joe_pool_is Posted April 2, 2009 Author Posted April 2, 2009 Thanks Derek, This is an ongoing project that I occasionally get a call to do some fixes or updates to (you are welcome to take over, if you are interested). I tried removing these lines, thinking they were comments, and the page simply did not work. I new there was something else involved, but symbols (like <!-- --> and <%-- --%>) are difficult to look up in a search engine. Quote Avoid Sears Home Improvement
Fork501 Posted April 2, 2009 Posted April 2, 2009 Thanks Derek, This is an ongoing project that I occasionally get a call to do some fixes or updates to (you are welcome to take over, if you are interested). I tried removing these lines, thinking they were comments, and the page simply did not work. I new there was something else involved, but symbols (like <!-- --> and <%-- --%>) are difficult to look up in a search engine. I hear you on that one! I'm glad I came across this post, though. Gives me a topic to blog about :D ~Derek Quote Check out my blog! DevPaper.NET
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.