473,385 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Strange ascx compilation error

Strange one here, got an ascx with the following line in it:

<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Filename
%>" />

All works fine, and my Gallery object has a Filename property.
I've just added Gallery.Directory, and changed the above line to this:

<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Directory
%>/<%# Gallery.Filename %>" />

And now get the error

CS1040: Preprocessor directives must appear as the first non-whitespace
character on a line

I tried changing them both to .Filename, in case I'd forgotten to completely
add the Directory property, but still the same. I tried adding "/Thumbs/"
instead of just a "/" between the two, since it works in another control
(not an ASP:Image) that looks like this:

<img src="Photos/<%# Photo.Gallery.Directory%>/Thumbs/<%# Photo.Filename %>"
alt="<%# Photo.Title %>" />

Anyone ever come across this before?
--
Daisy The Cow
Nov 15 '05 #1
9 3855
try this:
<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Directory
+ "/" + Gallery.Filename %>" />

You're probably hitting some sort of bug in the aspx-to-C# converter, where
it's not generating correct C# source code.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"Daisy" <da***@nospam.oops> wrote in message
news:7b***************@newsfep4-winn.server.ntli.net...
Strange one here, got an ascx with the following line in it:

<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Filename
%>" />

All works fine, and my Gallery object has a Filename property.
I've just added Gallery.Directory, and changed the above line to this:

<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Directory %>/<%# Gallery.Filename %>" />

And now get the error

CS1040: Preprocessor directives must appear as the first non-whitespace
character on a line

I tried changing them both to .Filename, in case I'd forgotten to completely add the Directory property, but still the same. I tried adding "/Thumbs/"
instead of just a "/" between the two, since it works in another control
(not an ASP:Image) that looks like this:

<img src="Photos/<%# Photo.Gallery.Directory%>/Thumbs/<%# Photo.Filename %>" alt="<%# Photo.Title %>" />

Anyone ever come across this before?
--
Daisy The Cow

Nov 15 '05 #2
Can you look at the source code that the ASP.NET csharp compiler generates?
Or send it so that we can see what is wrong with the code?

"Grant Richins [MS]" <gr*****@online.microsoft.com> wrote in message
news:#1*************@TK2MSFTNGP12.phx.gbl...
try this:
<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Directory + "/" + Gallery.Filename %>" />

You're probably hitting some sort of bug in the aspx-to-C# converter, where it's not generating correct C# source code.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.

"Daisy" <da***@nospam.oops> wrote in message
news:7b***************@newsfep4-winn.server.ntli.net...
Strange one here, got an ascx with the following line in it:

<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Filename %>" />

All works fine, and my Gallery object has a Filename property.
I've just added Gallery.Directory, and changed the above line to this:

<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%#

Gallery.Directory
%>/<%# Gallery.Filename %>" />

And now get the error

CS1040: Preprocessor directives must appear as the first non-whitespace
character on a line

I tried changing them both to .Filename, in case I'd forgotten to

completely
add the Directory property, but still the same. I tried adding "/Thumbs/" instead of just a "/" between the two, since it works in another control
(not an ASP:Image) that looks like this:

<img src="Photos/<%# Photo.Gallery.Directory%>/Thumbs/<%# Photo.Filename

%>"
alt="<%# Photo.Title %>" />

Anyone ever come across this before?
--
Daisy The Cow


Nov 15 '05 #3
"Sankar Nemani" <sn*****@nospamlumedx.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Can you look at the source code that the ASP.NET csharp compiler generates? Or send it so that we can see what is wrong with the code?


If you explain how to do it, maybe... I've not been poking around in things
I didn't write yet :D
--
Daisy The Cow
Nov 15 '05 #4
When you get the error message in the web page the error message contains
the path to the file it generated. And more over ther is a link to see the
source code on the error page.
"Daisy" <da***@nospam.oops> wrote in message
news:bu**********@linux01.dannytuppeny.com...
"Sankar Nemani" <sn*****@nospamlumedx.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Can you look at the source code that the ASP.NET csharp compiler generates?
Or send it so that we can see what is wrong with the code?


If you explain how to do it, maybe... I've not been poking around in

things I didn't write yet :D
--
Daisy The Cow

Nov 15 '05 #5
"Sankar Nemani" <sn*****@nospamlumedx.com> wrote in message
news:eD**************@TK2MSFTNGP12.phx.gbl...
When you get the error message in the web page the error message contains
the path to the file it generated. And more over ther is a link to see the
source code on the error page.


Right, here's a saved copy of the source of that page. Code expands when you
click the link:

http://dannytuppeny.co.uk/error.htm

What's commented as Line 6 of Gallery.ascx is:

Line 34: #line 6
"http://localhost/MySite/Gallery/Controls/Gallery.ascx"
Line 35: protected System.Web.UI.WebControls.Image galleryPhoto;

Which doesn't look like it'd cause that error at all... Any suggestions?
Nov 15 '05 #6
"Daisy" <da***@nospam.oops> wrote in message
news:bu**********@linux01.dannytuppeny.com...
Right, here's a saved copy of the source of that page. Code expands when you click the link:

http://dannytuppeny.co.uk/error.htm

What's commented as Line 6 of Gallery.ascx is:

Line 34: #line 6
"http://localhost/MySite/Gallery/Controls/Gallery.ascx"
Line 35: protected System.Web.UI.WebControls.Image galleryPhoto;

Which doesn't look like it'd cause that error at all... Any suggestions?


Ah, I see, lots of bits of code reference that same line...

It's gotta be this bit:

Line 154: #line 6
"http://localhost/MySite/Gallery/Controls/Gallery.ascx"
Line 155: target.ImageUrl =
System.Convert.ToString(Gallery.Directory %>/<%# Gallery.Filename);

Does this suggest a bug in what isn't my code? :(
--
Daisy The Cow
Nov 15 '05 #7
"Grant Richins [MS]" <gr*****@online.microsoft.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
try this:
<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Directory + "/" + Gallery.Filename %>" />

You're probably hitting some sort of bug in the aspx-to-C# converter, where it's not generating correct C# source code.


<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%# Gallery.Directory
+ "/" + Gallery.Filename %>" />

This gives "The server tag is not well formed." :o(
--
Daisy The Cow
Nov 15 '05 #8
You have this
<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%#Gallery.Directory>
+ "/" + Gallery.Filename %>" />
try this instead (try this as is and see)
<asp:Image id="galleryPhoto" runat="server" ImageUrl=<%#Gallery.Directory +
"/" + Gallery.Filename %> />

sorry for the delayed response
Sankar Nemani

"Daisy" <da***@nospam.oops> wrote in message
news:bu**********@linux01.dannytuppeny.com...
"Daisy" <da***@nospam.oops> wrote in message
news:bu**********@linux01.dannytuppeny.com...
Right, here's a saved copy of the source of that page. Code expands when

you
click the link:

http://dannytuppeny.co.uk/error.htm

What's commented as Line 6 of Gallery.ascx is:

Line 34: #line 6
"http://localhost/MySite/Gallery/Controls/Gallery.ascx"
Line 35: protected System.Web.UI.WebControls.Image galleryPhoto;
Which doesn't look like it'd cause that error at all... Any suggestions?


Ah, I see, lots of bits of code reference that same line...

It's gotta be this bit:

Line 154: #line 6
"http://localhost/MySite/Gallery/Controls/Gallery.ascx"
Line 155: target.ImageUrl =
System.Convert.ToString(Gallery.Directory %>/<%# Gallery.Filename);

Does this suggest a bug in what isn't my code? :(
--
Daisy The Cow

Nov 15 '05 #9
"Sankar Nemani" <sn*****@nospamlumedx.com> wrote in message
news:e%****************@TK2MSFTNGP10.phx.gbl...
You have this
<asp:Image id="galleryPhoto" runat="server" ImageUrl="<%#Gallery.Directory> + "/" + Gallery.Filename %>" />
try this instead (try this as is and see)
<asp:Image id="galleryPhoto" runat="server" ImageUrl=<%#Gallery.Directory + "/" + Gallery.Filename %> />

sorry for the delayed response


No problem, you sorted it!

Looks meesy without the quotes, but it's only a server tag!

Thanks :)

--
Daisy The Cow
Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jill Graham | last post by:
Hi, From time to time, I receive following error message when trying to access my website. When the error occurs, I have to recompile my dll until the error disappears (this without changing...
7
by: Holger (David) Wagner | last post by:
Hi Group, I've searched the Web for precompilers that compile ASPX/ASCX pages just like it can be done with JSPs, but so far, I've only found approaches targetted at increasing the performance....
2
by: bijoy | last post by:
I have the C# web application running on 2 servers - dev and prod. Dev runs Win2K and the prod runs Win 2K3. I noticed some strange behavior on the 2k3 machine. When I copy over all the required...
0
by: Vish | last post by:
Hi, We are having issues whenever we push the dynamically compiled .ascx files into prod. These are the files with no codebehind and what happens is that the old users see this error and the new...
2
by: f0zzyNUE | last post by:
hi everyone, currently we are testing the performance our application (asp.net based CMS) ... for that reason we wrote a "spider" that starts webrequests for all relevant pages which results in...
2
by: =?Utf-8?B?UGF1bCBCdXp6YSwgb2xkc3RlciB1c2luZyBuZXcg | last post by:
I recently implemented error processing on my .net website, where I send myself an email from global.asax on an application error. In the last two days I have gotten a "The file '/detail.aspx'...
1
by: Handle | last post by:
I want to customize some aspx / ascx files of a precompiled site (the project portofolio web access site). I have no access to source code. Using Visual Studio, when I try to edit one these files...
3
by: Tomasz J | last post by:
Hello Developers, I have a control derived from System.Web.UI.WebControls.WebControl. Control has this property: public string Value { set { _value = value; } get { return _value; }
11
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine Windows Server 2003 using IIS 6.0 and I am getting the error BC30560 prjob_ascx is ambiguous in the namespace ASP I found a fix. Deleting all the files in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.