Bug 5875 - Can't use a javascript less than operator (<) in ASP Content Control
Summary: Can't use a javascript less than operator (<) in ASP Content Control
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: ASP.Net ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-06-26 17:08 UTC by Zachary Sheppard
Modified: 2015-09-17 08:59 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Zachary Sheppard 2012-06-26 17:08:34 UTC
Description of Problem: We are taking advantage of the ContentPlaceholder controls to group our javascript functions and therefore we created a placeholder in the master page where all of our JS functions will reside. The functions themselves are specified in the pages that inherit from that master page. if we put a less than (<) operator anywhere in a JS function the IDE interprets that tag as the starting tag of an html element and assumes that there is an unfinished tag. I wonder if this could also be the cause of this issue (https://bugzilla.xamarin.com/show_bug.cgi?id=5516). I tried changing the less than symbol to a greater than symbol and it works just fine... it's only the less than that messes everything up. I changed my for loops to the JS for in loops so that it will run for now but this probably needs to be fixed. Here is a simple example function that should break the Content control:

function DoSomething()
{
     for(var i = 0; i < 10; i++) {
          alert(i);
     }
}


Steps to reproduce the problem:
1. Create a master page and in the head tag paste this:

<script type="text/javascript">
     <asp:ContentPlaceHolder ID="JSFunctions" runat="server" />
</script>

2. Create a page that inherits from this master page and paste this:

<asp:Content ContentPlaceHolderID="JSFunctions" runat="server">

function DoSomething()
{
     for(var i = 0; i < 10; i++) {
          alert(i);
     }
}

</asp:Content>	

3. You should get an error inside of mono's editor on the </asp:Content> tag that reads "Closing tag 'asp:Content' does not match opening tag '10'"... or something along those lines

Actual Results: can't define my javascript functions in a content control


Expected Results: To be able to add functions depending on the page I load and not have errors


How often does this happen? every time


Additional Information:
Comment 1 Matt Ward 2015-09-17 08:59:16 UTC
Unable to reproduce this in Xamarin Studio 5.9 so I am marking this as fixed.