При загрузке файла .aspx на сервер я получаю сообщение об ошибке во время выполнения. Я загружал файлы ранее в том же формате, и они работали нормально, поэтому мой сервер поддерживает эту службу.
Кроме того, приложение работает нормально на моем локальном сервере.
Это ошибка:
Ошибка выполнения
Описание: на сервере произошла ошибка приложения. Текущие пользовательские настройки ошибок для этого приложения не позволяют удаленно просматривать подробности ошибки приложения (из соображений безопасности). Однако его могут просматривать браузеры, работающие на локальном сервере.
Подробности. Чтобы детали этого конкретного сообщения об ошибке можно было просматривать на удаленных компьютерах, создайте тег в файле конфигурации «web.config», расположенном в корневом каталоге текущего веб-приложения. Для этого тега должен быть установлен атрибут «mode» «Off».
А это мой код:
<%@ Page Language="C#" %> <%@ import Namespace="System.IO" %> <%@ import Namespace="System" %> <%@ import
Namespace = "System.Collections.Generic"%> <% @ import
Namespace = "System.Linq"%> <% @ import Namespace = "System.Web"%> <% @
import Namespace = "System.Web.UI"%> <% @ import
Namespace = "System.Web.UI.WebControls"%>
public void Button1_Click(object sender, EventArgs e)
{
//This a program that calculates your mortgage payments
//Variables used
double p;
double m = 0;
double rate = 0;
int years = 0;
int ny = 0;
bool result = false;
rate = DropDownList2.SelectedIndex; //Here we get the values from the comboBox1 and assign it to the variable "rate"
//The following IF statements get the value from the radio buttons and assign it to the variable "years"
if (RadioButtonList2.SelectedIndex == 0)
{
years = 15;
}
if (RadioButtonList2.SelectedIndex == 1)
{
years = 30;
}
if (RadioButtonList2.SelectedIndex == 2 && TextBox5.Text != null)
{
if (int.TryParse(TextBox4.Text, out ny))
{
years = ny;
}
}
//A simple if statement to check if the user filled out all values necessary for the calculation.
//if any of the values where wrong or missing the program prompts the user to check his/her input again
if (years != 0 && rate != 0 && double.TryParse(TextBox4.Text, out p))
{
m = (p * rate / 1200.0) / (1 - Math.Pow((1.0 + rate / 1200.0), -12.0 * years));
result = true;
}
else
{
TextBox6.Text = "Please fill all boxes!";
}
//If all of the above steps checks true then the payment amount is displayed on textBox3
if (result == true)
{
TextBox6.Text = m + "";
StreamWriter sw = File.AppendText("d:/log_file.txt");
sw.WriteLine(DateTime.Now + "\nAmount: " + m + "");
sw.WriteLine();
sw.Close();
}
}
public void Button2_Click(object sender, EventArgs e)
{
TextBox4.Text = null;
TextBox5.Text = null;
TextBox6.Text = null;
RadioButtonList2.SelectedIndex = 0;
}
public void Page_Load(object sender, EventArgs e)
{
} </script>
<script src="css_browser_selector.js" type="text/javascript"></script>
Geo Nicolaides | Ежемесячные платежи
$ (документ) .ready (function () {
$ ( '# Page_effect') FadeIn (500).
});
Георгий Николаидес
IT-330
<div class="footer">
<div id="nav">
<div class="navlist1">
<ul> <li> <a class="navlist" href="index.html">Home</a> </li></ul>
</div>
<div class="navlist1">
<ul> <li><a class="active" href="projects.html" >Projects</a></li> </ul>
</div>
<div class="navlist1">
<ul> <li><a class="navlist" href="view-log.aspx" >Log Files</a></li> </ul>
</div>
</div>
</div> </div>
<div class="wrapper2">
<div class="content">
<div id="page_effect" style="display:none;">
<asp:Label ID="Label6" runat="server" Text="Years of payments:" ForeColor="White"></asp:Label>
<asp:RadioButtonList ID="RadioButtonList2" runat="server" style="margin-left:0px; color:White;">
<asp:ListItem>15</asp:ListItem>
<asp:ListItem>30</asp:ListItem>
<asp:ListItem>Other</asp:ListItem>
</asp:RadioButtonList>
<asp:TextBox ID="TextBox5" runat="server" style="margin-left:0px" Width="47px"></asp:TextBox>
<br />
<asp:Label ID="Label7" runat="server" Text="Interest Rate" ForeColor="White"></asp:Label> <br />
<asp:DropDownList ID="DropDownList2" runat="server" Height="23px"
style="margin-left: 0px">
<asp:ListItem Selected="True">Rate</asp:ListItem>
<asp:ListItem>3.0</asp:ListItem>
<asp:ListItem>3.5</asp:ListItem>
<asp:ListItem>4.0</asp:ListItem>
<asp:ListItem>4.5</asp:ListItem>
<asp:ListItem>5.0</asp:ListItem>
<asp:ListItem>5.5</asp:ListItem>
<asp:ListItem>6.0</asp:ListItem>
</asp:DropDownList>
<br /> <br />
<asp:Button ID="Button2" runat="server" style="margin-left: 0px"
Text="Calculate" onclick="Button1_Click" ForeColor="Black"
Height="37px" Width="119px" />
<br /> <br />
<asp:Label ID="Label8" runat="server" Text="Monthly Payment:" ForeColor="White"></asp:Label>
<asp:TextBox ID="TextBox6" runat="server" style="margin-left: 0px"
AutoPostBack="True" BackColor="White" Columns="50" ReadOnly="True"
ViewStateMode="Enabled" Width="142px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" style="margin-left: 0px"
Text="Reset" onclick="Button2_Click" ForeColor="Black"
Height="37px" Width="119px" />
<br /> <br />
<div class="largespacebelow">
</div>
</div>
</div>
</div>
<div class="push2">