Principiante alle prime armi

martedì 07 marzo 2006 - 11.36

lordwaizard Profilo | Senior Member

Scusate per le domande ma ho sempre lavorato per le applicazioni con vb.net e per il web in php.

1)Dovrei realizzare un piccolo script che esegue delle operazioni e al termine ha come ouput un file di testo.

In php lo risolvevo così
header('Content-type: FORMATO');
readfile("file.txt");
breack;

E' possibile realizzarlo con asp2.0?

2) Ho fatto una prova per imparare e in locale funziona mentre sul web mi da "Server Error in '/' Application."

Allora modifico il Web.config

L'errore che esce in conclusione è
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load the assembly 'App_Web_zd5x6cnn'. Make sure that it is compiled before accessing the page.

Source Error:


Line 1: <%@ page language="VB" autoeventwireup="false" inherits="_Default, App_Web_zd5x6cnn" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Source File: /imposta/Default.aspx Line: 1

Dove sbaglio? la pubblicazione la eseguo da VS.net 2005 Pro.
Il file in questione è presente nella cartella bin.
Scusate ancora e grazie per il vostro aiuto.
Davide

lordwaizard Profilo | Senior Member

1) Nel primo caso non ho realizzato ancora niente.
2) Ho creato un nuovo progetto:

Pagina
<%@ 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>Pagina senza titolo</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Height="48px" Text="Label" Width="416px"></asp:Label>
<br />
<asp:CheckBox ID="CheckBox1" runat="server" /></div>
</form>
</body>
</html>




Pagina vb.

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = Server.MapPath("~/")

End Sub
End Class
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5