Saturday, March 24, 2012

trouble with an aspx page

I have developed my first page in aspx, I have done with webmatrix and executing ( f5 ) it works fine but when I try to test using explorer it don´t work.

My SO is w 2000 profesional and I have installed IIS.

thanks in advanceHi,

can you explain more specifically what you mean by "it doesn't work"?
when I open the file .aspx with the explorer I get the next message:

Error in execution

line 3
Error: Expected ';'

it happen openning all the aspx pages with webmatrix they work without trouble.

Thanks for your reply
Can you please show the code in question? Are you using C#? In that case, are you using "line terminator" (;) as it should be used?
How are you opening the page? Are you including localhost (eg http://localhost/test.aspx)?
My code is:


<%@. Page Language="VB" %>
<script runat="server"
Sub Button1_Click(sender As Object, e As EventArgs)
if TextBox1.text = "" then
msgbox("Nooo")
end if
Label1.text = " hola " & TextBox1.text & ". Buenos días, la fecha es: " & Calendar1.selecteddate
TextBox1.text = ""
End Sub

Sub Calendar1_Load(sender As Object, e As EventArgs)
dim hoy
hoy = Now
calendar1.selecteddate = hoy
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<!-- Insert content here -->
<table style="WIDTH: 194px; HEIGHT: 170px">
<tbody>
<tr>
<td>
<asp:Label id="Label1" runat="server" width="123px">Label</asp:Label></td>
</tr>
<tr>
<td>
<asp:TextBox id="TextBox1" runat="server">Anto</asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Calendar id="Calendar1" runat="server" Width="232px" BackColor="White" DayNameFormat="FirstLetter" ForeColor="Black" Height="180px" Font-Size="8pt" Font-Names="Verdana" BorderColor="#999999" CellPadding="4" OnLoad="Calendar1_Load">
<TodayDayStyle forecolor="Black" backcolor="#CCCCCC"></TodayDayStyle>
<SelectorStyle backcolor="#CCCCCC"></SelectorStyle>
<NextPrevStyle verticalalign="Bottom"></NextPrevStyle>
<DayHeaderStyle font-size="7pt" font-bold="True" backcolor="#CCCCCC"></DayHeaderStyle>
<SelectedDayStyle font-bold="True" forecolor="White" backcolor="#666666"></SelectedDayStyle>
<TitleStyle font-bold="True" bordercolor="Black" backcolor="#999999"></TitleStyle>
<WeekendDayStyle backcolor="#FFFFCC"></WeekendDayStyle>
<OtherMonthDayStyle forecolor="Gray"></OtherMonthDayStyle>
</asp:Calendar>
</td>
</tr>
<tr>
<td>
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>


I don't think that your code is the issue here (although you can't use msgbox in ASP.NET - it's JavaScript) as it has been working in WebMatrix. In order for the script to be processed you need to type http://localhost/[filename].aspx in the address bar. Are you doing this?
No ,

I open webmatrix
open myfile.aspx
menu wiev F5
I choose the option : Use Asp Webmatrix Server Port 8080 and it works

when the another options it don´t work gives the error .
In your first post you said that it didn't work when you open it in [internet] explorer. I don't know what the options are (in WebMatrix), but it sounds like there isn't really a problem - you need to use Port 8080 to use HTTP.

0 comments:

Post a Comment