Testing Mono's compatibility

Joseph Sinclair plug-discussion at stcaz.net
Wed Sep 13 17:22:52 MST 2006


It's not Mono in this case (which does a great job of handling .Net code, as long as you avoid the MS-proprietary extension libraries), you're feeding it malformed ASP.Net code.

The entire structure of ASP code changed with ASP.NET, but you're feeding it escaped VBScript code that's not even ASP.Net, it's old-style ASP, which simply won't work.  What it's actually doing is copying the escaped code into a C# file, then trying to compile that, and failing because your code is VBScript, not C#.

Try something more like the following (borrowed from W3Schools example pages):

_______________________________________________________
<script  runat="server">
Sub submit(sender As Object, e As EventArgs)
Dim row,numrows,numcells,j,i
row=0
numrows=rows1.Value
numcells=cells1.Value
for j=1 to numrows
   Dim r As New HtmlTableRow()
   row=row+1
   for i=1 to numcells
     Dim c As New HtmlTableCell()
     c.Controls.Add(New LiteralControl("row " & j & ", cell " & i))
     r.Cells.Add(c)
   next
   t1.Rows.Add(r)
   t1.Visible=true
next
End Sub
</script>

<html>
<body>

<form runat="server">
<p>Table rows:
<select id="rows1" runat="server">
   <option value="1">1</option>
   <option value="2">2</option>
   <option value="3">3</option>
</select>
<br />Table cells:
<select id="cells1" runat="server">
   <option value="1">1</option>
   <option value="2">2</option>
   <option value="3">3</option>
</select>
<br /><br />
<input type="submit" value="Display Table" runat="server" OnServerClick="submit">
</p>
<table id="t1" border="1" runat="server" visible="false"/>
</form>

</body>
</html>
_______________________________________________________________

Be sure to save the file with the .ASPX extension, the .ASP extension is handled by a different interceptor (to maintain backward compatibility), that probably won't like this code.

For C# in ASP.Net, it gets a bit more quirky, and it's not recommended if you still have legacy ASP, since ASP.Net C# code can't (usually) share a session with legacy ASP, only VB.Net code in ASP.Net can do that (easily) (I know it gets really confusing, what do you expect from a proprietary company)

If you still have problems, it's best to get someone more familiar with ASP.Net to assist you, since you really have to know the development model and the server configuration options both to get it all working just right.

FoulDragon at aol.com wrote:
> So I'm told we need some form of .NET combatability for our FC4 server.
> 
> I fire up Yum and install the mono-complete package, but the resultant 
> install seems to be incredibly easy to break.
> 
> If I just put
> 
> <% dim variablename; %>
> 
> it has a fit.
> 
> Error message: /tmp/apache-temp-aspnet-0/bbce3785/87108.0.cs(61,13) : error 
> CS0246: The type or namespace name `dim' could not be found. Are you missing a 
> using directive or an assembly reference?
> 
> Forget about anything more complex for now.
> 
> Is Mono more difficult to install than a conventional ball of RPMs?  Does it 
> need some post-install cleanup?  Or is it just the .NET version of WINE, 
> setting up elaborate dreams then leaving you wanting when it actually comes to 
> compatibility?  Or am I misinterpeting the "ASP.NET for complete fools who can't 
> understand why PHP isn't good enough" sites?
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: OpenPGP digital signature
Url : http://lists.plug.phoenix.az.us/pipermail/plug-discuss/attachments/20060913/74ec4ba7/signature-0001.pgp


More information about the PLUG-discuss mailing list