Help with code blocks inside html tags in .Aspx files

View: New views
4 Messages — Rating Filter:   Alert me  

Help with code blocks inside html tags in .Aspx files

by A. Leon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm also a new mono user, and I'm actually trying to port an existing asp.net application to mono.
I've encountered a problem with code blocks within html tags and cant find a way to run around it.

To better explain my  problem I have this simple sample code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">
    <title>Mono Tester</title>
</head>
<body >
    <form id="form1" runat="server" onload="form1_Load">
     <%=strString%>
     
    <div id="H<%=intID%>">
        Mono Tester<br />
        <br />
        <br />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></div>
       
        <input id="input<%=intID%>" value="<%=strString%>" type="text" />
    </form>  
</body>


</html>

the code behind file looks like this:

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected strString As String
    Protected intId As Integer

    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        strString = "Random data"
        intId = 1
        Me.TextBox1.Text = strString
    End Sub
End Class

I have no problems running the application on windows, but on mono every code block inside a tag causes an error:

Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

Compiler Error Message: /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(191,1) : error VBNC30037: Symbol is not valid.
/tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(204,1) : error VBNC30037: Symbol is not valid.
/tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(212,1) : error VBNC30037: Symbol is not valid.

Source Error:

Line 189:             #ExternalSource(/srv/www/htdocs/payswitch/PFCLIENT/Default.aspx, 11)
Line 190:             __output.Write(""&Microsoft.VisualBasic.ChrW(10)&"     "&Microsoft.VisualBasic.ChrW(10)&"    <div id=""H")
Line 191:             #End ExternalSource
Line 192:            
Line 193:             #ExternalSource(@@inner_string@@, 1)


if I remove the code blocks located inside tags, the application runs ok, any other way produces this error.

The problem is that in the actual application I'm working on this is is used heavily, so I would like to know if there's any way to work around this problem.

Any suggestions or ideas are very welcome!

Thanks in advance for your time and cooperation,
Alberto León


Re: Help with code blocks inside html tags in .Aspx files

by Rolf Bjarne Kvinge-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

> I have no problems running the application on windows, but on mono
> every code block inside a tag causes an error:
>
> Description: Error compiling a resource required to service this
> request.
> Review your source file and modify it to fix this error.
>
> Compiler Error Message:
> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(191,1) : error
> VBNC30037: Symbol is not valid.
> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(204,1) : error
> VBNC30037: Symbol is not valid.
> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(212,1) : error
> VBNC30037: Symbol is not valid.
>
> Source Error:
>
> Line 189:
> #ExternalSource(/srv/www/htdocs/payswitch/PFCLIENT/Default.aspx, 11)
> Line 190:
> __output.Write(""&Microsoft.VisualBasic.ChrW(10)&"
> "&Microsoft.VisualBasic.ChrW(10)&"    <div id=""H")
> Line 191:             #End ExternalSource
> Line 192:
> Line 193:             #ExternalSource(@@inner_string@@, 1)
>

Which version of mono are you using?

This should be fixed in newer versions, it is in 1.9 for sure, might be in slightly older versions too (can't remember exactly when I fixed it).

Rolf

>
> if I remove the code blocks located inside tags, the application runs
> ok,
> any other way produces this error.
>
> The problem is that in the actual application I'm working on this is is
> used
> heavily, so I would like to know if there's any way to work around this
> problem.
>
> Any suggestions or ideas are very welcome!
>
> Thanks in advance for your time and cooperation,
> Alberto León
>
>
> --
> View this message in context: http://www.nabble.com/Help-with-code-
> blocks-inside-html-tags-in-.Aspx-files-tp17679428p17679428.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-vb mailing list
> Mono-vb@...
> http://lists.ximian.com/mailman/listinfo/mono-vb
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 270.0.0/1484 - Release Date:
> 04/06/2008 16:40

_______________________________________________
Mono-vb mailing list
Mono-vb@...
http://lists.ximian.com/mailman/listinfo/mono-vb

Re: Help with code blocks inside html tags in .Aspx files

by davideveloper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HI,

The error occurs even in version 1.9.1, I reviewed the vb code generated by the VBCodeGenerator class, the lines 189 and 193 are not well formed (see  code below), the first parameter for the ExternalSource directive must be a stringLiteral, the vbnc fails when parsing this parameter, the token @@inner_string@@ is not accepted by the compiler, oddly the compiler does not fails when parsing the token /Default.aspx, I think he should. It seems the error comes from the VBCodeGenerator class when generating the code from the aspx page.

Line 189:             #ExternalSource(/Default.aspx, 11)

Line 193:             #ExternalSource(@@inner_string@@, 1)


Rolf Bjarne Kvinge-2 wrote:
Hi,

> I have no problems running the application on windows, but on mono
> every code block inside a tag causes an error:
>
> Description: Error compiling a resource required to service this
> request.
> Review your source file and modify it to fix this error.
>
> Compiler Error Message:
> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(191,1) : error
> VBNC30037: Symbol is not valid.
> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(204,1) : error
> VBNC30037: Symbol is not valid.
> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(212,1) : error
> VBNC30037: Symbol is not valid.
>
> Source Error:
>
> Line 189:
> #ExternalSource(/srv/www/htdocs/payswitch/PFCLIENT/Default.aspx, 11)
> Line 190:
> __output.Write(""&Microsoft.VisualBasic.ChrW(10)&"
> "&Microsoft.VisualBasic.ChrW(10)&"    <div id=""H")
> Line 191:             #End ExternalSource
> Line 192:
> Line 193:             #ExternalSource(@@inner_string@@, 1)
>

Which version of mono are you using?

This should be fixed in newer versions, it is in 1.9 for sure, might be in slightly older versions too (can't remember exactly when I fixed it).

Rolf

>
> if I remove the code blocks located inside tags, the application runs
> ok,
> any other way produces this error.
>
> The problem is that in the actual application I'm working on this is is
> used
> heavily, so I would like to know if there's any way to work around this
> problem.
>
> Any suggestions or ideas are very welcome!
>
> Thanks in advance for your time and cooperation,
> Alberto León
>
>
> --
> View this message in context: http://www.nabble.com/Help-with-code-
> blocks-inside-html-tags-in-.Aspx-files-tp17679428p17679428.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-vb mailing list
> Mono-vb@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 270.0.0/1484 - Release Date:
> 04/06/2008 16:40

_______________________________________________
Mono-vb mailing list
Mono-vb@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-vb

Re: Help with code blocks inside html tags in .Aspx files

by Rolf Bjarne Kvinge-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



> -----Original Message-----
> From: mono-vb-bounces@... [mailto:mono-vb-
> bounces@...] On Behalf Of davideveloper
> Sent: miércoles, 11 de junio de 2008 16:56
> To: mono-vb@...
> Subject: Re: [mono-vb] Help with code blocks inside html tags in .Aspx
> files
>
>
> HI,
>
> The error occurs even in version 1.9.1, I reviewed the vb code
> generated by the VBCodeGenerator class, the lines 189 and 193 are not well formed
> (see code below), the first parameter for the ExternalSource directive must
> be a stringLiteral, the vbnc fails when parsing this parameter, the token
> @@inner_string@@ is not accepted by the compiler, oddly the compiler
> does not fails when parsing the token /Default.aspx, I think he should. It
> seems the error comes from the VBCodeGenerator class when generating the code
> from the aspx page.
>
> Line 189:             #ExternalSource(/Default.aspx, 11)
>
> Line 193:             #ExternalSource(@@inner_string@@, 1)
>

You're right, looking at when the releases was made it looks like it didn't get into neither 1.9 nor 1.9.1.

It will be in the upcoming 2.0 release, or you can compile your own mono from svn HEAD which will also have this fixed.

Rolf

>
>
> Rolf Bjarne Kvinge-2 wrote:
> >
> > Hi,
> >
> >> I have no problems running the application on windows, but on mono
> >> every code block inside a tag causes an error:
> >>
> >> Description: Error compiling a resource required to service this
> >> request.
> >> Review your source file and modify it to fix this error.
> >>
> >> Compiler Error Message:
> >> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(191,1) :
> error
> >> VBNC30037: Symbol is not valid.
> >> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(204,1) :
> error
> >> VBNC30037: Symbol is not valid.
> >> /tmp/root-temp-aspnet-0/da6ebdb7/App_Web_12e5d8ea_1.vb(212,1) :
> error
> >> VBNC30037: Symbol is not valid.
> >>
> >> Source Error:
> >>
> >> Line 189:
> >> #ExternalSource(/srv/www/htdocs/payswitch/PFCLIENT/Default.aspx, 11)
> >> Line 190:
> >> __output.Write(""&Microsoft.VisualBasic.ChrW(10)&"
> >> "&Microsoft.VisualBasic.ChrW(10)&"    <div id=""H")
> >> Line 191:             #End ExternalSource
> >> Line 192:
> >> Line 193:             #ExternalSource(@@inner_string@@, 1)
> >>
> >
> > Which version of mono are you using?
> >
> > This should be fixed in newer versions, it is in 1.9 for sure, might
> be in
> > slightly older versions too (can't remember exactly when I fixed it).
> >
> > Rolf
> >
> >>
> >> if I remove the code blocks located inside tags, the application
> runs
> >> ok,
> >> any other way produces this error.
> >>
> >> The problem is that in the actual application I'm working on this is
> is
> >> used
> >> heavily, so I would like to know if there's any way to work around
> this
> >> problem.
> >>
> >> Any suggestions or ideas are very welcome!
> >>
> >> Thanks in advance for your time and cooperation,
> >> Alberto León
> >>
> >>
> >> --
> >> View this message in context: http://www.nabble.com/Help-with-code-
> >> blocks-inside-html-tags-in-.Aspx-files-tp17679428p17679428.html
> >> Sent from the Mono - VB mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> Mono-vb mailing list
> >> Mono-vb@...
> >> http://lists.ximian.com/mailman/listinfo/mono-vb
> >>
> >> No virus found in this incoming message.
> >> Checked by AVG.
> >> Version: 8.0.100 / Virus Database: 270.0.0/1484 - Release Date:
> >> 04/06/2008 16:40
> >
> > _______________________________________________
> > Mono-vb mailing list
> > Mono-vb@...
> > http://lists.ximian.com/mailman/listinfo/mono-vb
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Help-with-code-
> blocks-inside-html-tags-in-.Aspx-files-tp17679428p17779815.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-vb mailing list
> Mono-vb@...
> http://lists.ximian.com/mailman/listinfo/mono-vb
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 270.2.0/1495 - Release Date:
> 10/06/2008 17:11

_______________________________________________
Mono-vb mailing list
Mono-vb@...
http://lists.ximian.com/mailman/listinfo/mono-vb