Causes Transient Aspx First Line Compile Errors?
Feb 8, 2010
Every once in a while, when I'm editing an aspx or ascx page, Visual Studio will start telling me there is an error on the first line of my file. For instance, right now, it is saying Argument missing on line 1. That line is just your typical header, with no apparent problems (to my eyes), and I hadn't even changed that one when the error started appearing.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyControl.ascx.cs"
Inherits="MyNamespace.MyControl" Debug="true" %>
Unlike most compile errors, the build still succeeds. (At least this time it did.)
It's worth noting that no other errors or warnings are thrown by this file or its as[p|c]x.cs
Sometimes, to get out of it, I am forced to undo my changes until it disappears and carefully redo what I wanted. This time, grasping at straws, I cleaned and rebuilt the solution. While I was typing this, the error disappeared, sometime after the rebuild finished.
I have a suspicion that it often happens when I tinker with the databinding in my markup. Sometimes it seems to appear if I'm missing a space inside a tag before its closing slash, like so:
[...] Text='<%# Eval("Field") %>'/>
versus:
[...] Text='<%# Eval("Field") %>' />
...But that doesn't seem to have been the problem in this case.
When coding PHP and Perl, sometimes the interpreter would throw an error referencing the very last line of the file. Over time, I learned to look for imbalanced brackets and other delimiters somewhere up above. This problem in ASP.NET feels similar, but stranger, since it's the first line, and not just something amiss above, cascading down to the bottom. Or is it just Visual Studio getting temporarily confused? Can any pros shed some light on this problem, with reasons why it happens? I'd like to have some logic (as opposed to my own built up superstition) to throw at this the next time it rears its ugly head.
View 1 Replies
Similar Messages:
Oct 31, 2011
I have a VS 2008 solution. I need to copy an existing .aspx page and re-name it to something else (need to make modifications to that newly copied page). But I keep getting compilation errors saying that duplicate text boxes exist. Can't I have control on different .aspx pages with the same name? How can I do this elegantly?
View 4 Replies
Apr 9, 2010
I have a Perl script that calls aspnet_compiler.exe to compile a large ASP.NET website. The problem is that it takes very long to run. Is there any way to compile just a single .aspx file from the command line? (I think that would suit the needs of my script) It seems that all aspnet_compiler.exe can do is compile at a directory level.
View 2 Replies
Dec 30, 2010
In my deployed web application I am getting the following error:
CS0103: The name 'releaseLionButton_Click' does
not exist in the current context
It identifies this as the offending line:
<asp:Button ID="releaseLionButton" runat="server"
Text="Release the Lion!"
OnClick="releaseLionButton_Click"></asp:Button>
[code]...
View 2 Replies
Jan 20, 2011
I have an ASP.NET website where the pages call a few components in DLLs. I need to change the signature of a method in the component, and short of doing a text search, don't know if this will break any pages or not. IMO, this is the weakness of web programming -- you don't get the benefit of a compiler telling you about syntax errors.
But it doesn't need to be so. Does anyone know if there is a way to run a spider over a website watching for compile errors, or perhaps some tool that would compile all the .aspx files in a folder structure looking for compile errors?
This is merely for syntax checking -- not to actually pre-compile the website.
EDIT It looks like aspnet_compiler is being recommended. I don't use Visual Studio projects for the website -- it's grown over time with my own templating system (back before Master Pages were available). So something that would run aspnet_compiler over all the files in a folder might work...
View 3 Replies
Mar 11, 2011
I am using TFS to build my MVC app. I cannot do it because I get lots of compile errors. I am using version 4 of .Net and MVC 2. On the build server I have the .Net framework 4.0 installed. It has been suggested that I should also download the MVC framework as well, but when I look on the net all I can find is this MVC framework; http://mvcframework.codeplex.com/ which does not seem to be relevant and does not work anyway.
One of the assemblies I am missing on the build server is System.Web.Mvc dll.Typical error messages include; "The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)"What do I need to do to fix this?
View 2 Replies
Jun 8, 2010
I have a drop down with different domains(domain_id column) and a textbox (TextBoxComment) for comments. What I am trying to do is select the area, input a comment, click the button and have it save to the db. My connection string errors on compile.
[Code]....
View 8 Replies
Jan 29, 2010
Working through Steven Sanderson's excellent Pro ASP.Net MVC Framework book.I am trying to reference the TempData collection to display a message after an item has been successfully updated and so have placed a reference to this on my Master Page.[Code]....
This is giving me the following compile time errors:
Error 1 The name 'TempData' does not exist in the current context <programme location>
Error 2 The name 'TempData' does not exist in the current context <programme location>
If I reference TempData on a content page it compiles (and works) fine.
View 3 Replies
Nov 3, 2010
I am trying to figure out how to publish a web app from a command line if there isn't a solution file present. Is this possible? Is it possible to generate a solution file from the command line? I would need example of how this is accomplished.
View 2 Replies
Jul 24, 2010
I'm working through the Mvc Music store tutorial on PDF. At page 52, near the bottom, is a line that reads:
<%: Html.EditorFor(model => Model.Album, new {Artists = Model.Artists, Genres = Model.Genres})%>
This line fails with an "unhandled compile" error when I run the program and enter "storemanager/edit/388" in the address bar. I have gone over every bit of code I can find and it compares perfectly to the tutorial.
View 3 Replies
May 7, 2010
For the first time in my career, I'm working on an ASP.Net (v3.5) project that has been set up as a Visual Studio 2008/10 Web Site Project.
I'm not keen on this way of working this way for various reasons but for the moment and until such time as the company sees the virtue in working in an environment with namespaces, designer and project files etc., I have to continue with the existing codebase.
I've run into some odd issues since I began this but perhaps the oddest one of all is that althought VS lets me build the code, it doesn't reliably pick up compilation errors so these are not noticed until runtime.
I know the website model allows dynamic/hot compilation when a request is made for a specific but I can't see why it wouldn't do this when I manually (F5) build/rebuild the project. Its immensely annoying as you can imagine and I can't find a workaround.
View 3 Replies
Nov 12, 2013
how can i compile command line through web application? my application is built on asp.net(C#)....
View 1 Replies
Jul 27, 2010
I have several class files in App_Code in an ASP.net website running in Microsoft Visual Studio 2005 Professional.In liu of using a full unit test suite I just want to somehow compile those project-wide classses into an .EXE so that I can nightly run unit tests on them.I do know how to create a separate C# library project consisting of those files and how to include them into my website--but that is not desirable--I don't want to give up the ability to make on-the-fly code changes of those library classes when running the website in the debugger. As far as I know .Net debugger isn't powerful enough to modify code in included libraries with instant auto re-compilation on page re-load.So, I want my cake and eat it, too:
Command-line unit testing of website class files in App_Code directoryBeing able to modify those class files w/o stopping/re-starting the web debugger.
View 2 Replies
Mar 11, 2011
I have an ASP.NET website that worked fine using and debugging in VS2008. I went through the upgrade process opening the solution in VS2010. I can run the site, but as I make changes in the app_code folder classes, they don't seem to commpile and warn me of compile-time errors. As soon as I get to a point that calls the class, the errors show up. Sounds JIT I guess, but this isn't how it was working in 08. Is there an option that was changed in the upgrade process? This is a large project, I really don't want to break something and not find out until some obscure page is opened.
View 1 Replies
Feb 22, 2011
The inline code
<% for (int i = 0; i < ThumbnailList.Items.Count; i++)
{ Response.Write("thumbnailViews[" + i.ToString() + "] = $find('" +
ThumbnailList.Items[i].FindControl("ThumbnailView").ClientID + "');
"); } %>
produces a bunch of compile time errors in Visual Studio 2008 - although it works fine.
But this seems to be the exact way inline code should be added, at least according to this MS help file:
[URL]
The errors are:
expected expression (at "<%")
expected ';' (at "int i")
expected ')' (at ThumbnailList.Items.Count;
expected ';' (at " i++)")
I have done a
<%@ Page Language="C#" ...
at the top of the file.
View 1 Replies
May 12, 2010
Is there a way to check for errors in unopened *.ASPX pages. For example, if you change the name of a function Visual Studio will catch the error on the page and list it in the "Error List" only if the page is opened and being validated?
How do i find out about the following without running the page through the webserver or opening the page to be validated in VS?
<script runat="server">
Public Sub MyFunciton()
Undefined_FUNCTION()
End Sub
</script>
View 2 Replies
Mar 16, 2010
After I installed the .net framework 3.5 to my iis box (which didn't have any previous version of .net fraemwork), I'm not long able to upload the aspx page via WebDav with MS Expression Web. I got the "HTTP/1.1 403 Forbidden " error message.
Also I got this error "Server Application Unavailable" when trying to open the aspx page. my iis box is not a domain controller nor a backup domain controller.
I have enabled the webservices extention - "ASP.NET v2.0.50727" and "WebDAV";
View 1 Replies
Feb 22, 2010
I often have an issue with compile errors when I copy over a aspx page and code behind file from another project, it seems to work when I create another page and the content manually but if I just copy the files it won't. I have checked to make sure namespaces and references are ok but still doesn't make any sense. The error I get is "Error The name 'txtUser' does not exist in the current context". I just wanted to understand why.
For e.g I copied over the following :
ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Login" %>
Login
Login
[Code]....
View 4 Replies
Jul 20, 2010
i am writting a function to Find and replace a particular string...I need to maintain a log history to understand the file name and line number I have replaced.The idea of such a log file is I can clearly understand wherall the changes have been made and which all files are altered.
View 2 Replies
Dec 31, 2010
[URL]
Is it possible to have radiobutton control list in one row. Now it is in 3 rows.
View 3 Replies
Dec 8, 2010
i made a web site by asp.net and it's work perfectly on locahost . But when I move it to major host , I see belw error ?
View 5 Replies
Jun 25, 2010
We invested in some nice widescreen monitors at work so we all have nice 1920x1200 resolution and a wide visual studio window when it is maximized. The problem is when we hit ctrl-k-d to autoformat the aspx code, it seems to default to a line length for a 4:3 monitor. Is there a way to overwrite this setting?
View 1 Replies
Mar 18, 2011
When I deploy my project to inetpub/wwwroot/ directory, and trying to run my index.aspx file though browser, it shows this error:Line 44: < authentication mode="Windows" / >
Source File: c:inetpubwwwrootconversionweb.config Line: 44
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618 I don't know what the problem is. How can this be fixed?
View 1 Replies
May 15, 2010
I'm writing my application in ASP.Net and everything works fine,but when I put it online,it won't display my .aspx pages.I get this error:
I keep getting this error when I put my asp files online:
Invalid @ Command directive
/left.aspx, line 1
The specified 'Page Language="vb" AutoEventWireup="false" Codebehind="left.aspx.vb" Inherits="shoppingknokkeheist.left" ' option is unknown or invalid.
View 3 Replies
Jul 7, 2010
I wrote a small .NET applications that removes all line breaks in aspx/html/css code to make it harder to read for people trying to steal my design. And surprisingly I get weird characters that appear out of nowhere such as Â, » and others. They all stay at the same places, but I have no clue why they appear.
View 2 Replies