I download the framework and install the IIS server 5.1, But when I
copy the code that supposed to print me 'hello world' from my manual
it didn't work. It showed me the page, but ignored the '.net' script.
What could be the reason?
Does my server version support asp.net?
This is the code I copy:
<%@dotnet.itags.org.Page Language="C#"%>
<script runat="server">
void Page_Load(object sender, EventArgs e) {
myLabel.Text = "Hello World!";
}
</script>
<html>
<head>
<title>My first ASP.NET page</title>
</head>
<body>
<asp:Label runat="server" id="myLabel"></asp:Label>
</body>
</html>
thanksOn Jul 13, 12:28 pm, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
> I download the framework and install the IIS server 5.1, But when I
> copy the code that supposed to print me 'hello world' from my manual
> it didn't work. It showed me the page, but ignored the '.net' script.
> What could be the reason?
> Does my server version support asp.net?
> This is the code I copy:
> <%@dotnet.itags.org.Page Language="C#"%>
> <script runat="server">
> void Page_Load(object sender, EventArgs e) {
> myLabel.Text = "Hello World!";
> }
> </script>
> <html>
> <head>
> <title>My first ASP.NET page</title>
> </head>
> <body>
> <asp:Label runat="server" id="myLabel"></asp:Label>
> </body>
> </html>
> thanks
Execute C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\aspnet_regiis.aspx -i
That should register the ASP.NET with IIS.
http://support.microsoft.com/kb/306005
On Jul 13, 1:01 pm, Alexey Smirnov <alexey.smir...@dotnet.itags.org.gmail.com> wrote:
> On Jul 13, 12:28 pm, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
>
>
>
>
>
>
>
> Execute C:\WINDOWS\Microsoft.NET\Framework
> \v2.0.50727\aspnet_regiis.aspx -i
> That should register the ASP.NET with IIS.
> http://support.microsoft.com/kb/306005
I only have this two 'version' directories:
v1.1.4322
v1.0.3705
and none of them contains the file aspnet_regiis.aspx
On Jul 13, 8:57 am, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
> On Jul 13, 1:01 pm, Alexey Smirnov <alexey.smir...@dotnet.itags.org.gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
> I only have this two 'version' directories:
> v1.1.4322
> v1.0.3705
> and none of them contains the file aspnet_regiis.aspx- Hide quoted text -
> - Show quoted text -
I recommend you install .Net framework 3.0.
On Jul 13, 3:07 pm, Larry Bud <larrybud2...@dotnet.itags.org.yahoo.com> wrote:
> On Jul 13, 8:57 am, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I recommend you install .Net framework 3.0.
Thanks I will try it. it supposed to make it work?
re:
!> I recommend you install .Net framework 3.0.
I hope you meant *.Net Framework 2.0*, and not 3.0,
since 3.0 has nothing which an ASP.NET developer needs.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Larry Bud" <larrybud2002@dotnet.itags.org.yahoo.com> wrote in message news:1184332075.248198.101630@dotnet.itags.org.m3g2000
hsh.googlegroups.com...
> On Jul 13, 8:57 am, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
> I recommend you install .Net framework 3.0.
>
On Jul 13, 1:44 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:
> re:
> !> I recommend you install .Net framework 3.0.
> I hope you meant *.Net Framework 2.0*, and not 3.0,
> since 3.0 has nothing which an ASP.NET developer needs.
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espa=F1ol :http://asp.net.do/foros/
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D
>
> "LarryBud" <larrybud2...@dotnet.itags.org.yahoo.com> wrote in messagenews:1184332075.24819=
8=2E101630@dotnet.itags.org.m3g2000hsh.googlegroups.com...
>
>
al
ipt.
>
>
>
>
>
>
>
>
>
>
t -
>
>
Yes, I mean 2.0
Showing posts with label download. Show all posts
Showing posts with label download. Show all posts
Wednesday, March 28, 2012
Thursday, March 22, 2012
The files are downloaded with the html code at the end of them
I have a code that download files form a folder to the client:
The problem is that if you open the files with 'notepad' you see that the html code of the page has been incorporated to the end of the file. Something like this:
Somebody knows what can be? How can I takeout the html code?
Could you tell me what that does? I've copy the code without it and it works anyway.
Try
Response.AddHeader("Content-Disposition", "attachment;filename=" & strFileName)
Dim fs As FileStream = New FileStream("C:\text.txt", FileMode.Open, FileAccess.Read)
Dim fileData As Byte()
ReDim fileData(fs.Length)
Dim bytesRead As Long = fs.Read(fileData, 0, CInt(fs.Length))
fs.Close()
Response.BinaryWrite(fileData)
Catch es as Exception
lblAlert.text = "It was a problem transferring the file."
end try
The problem is that if you open the files with 'notepad' you see that the html code of the page has been incorporated to the end of the file. Something like this:
***************Beginning of the file***************
0000114099 00000 n
0000114243 00000 n
0000114317 00000 n
trailer<</Size 62/ID<79e93880650e9d343ab0837ab878f5cd><79e93880650e9d343ab0837ab878f5cd>]>>
startxref 173 %%EOF
<html>
<head>
<title>HLC Intranet - HLC Eroom</title>
***************rest of the html code***************
Somebody knows what can be? How can I takeout the html code?
Thanks,
BriegaHi,
I presume this is some code-behind code. Check if there is still some html code in your page (this is created automatically when you create a new webform in vs.net). Delete the html code and only leave the Page-directive.
I struggled with this issue also last year and this is what worked for me:
Response.Clear()
Response.ContentType = scan.ContentType
Response.BinaryWrite(scan.Document)
Response.End()
Grz, Kris.
It works!!!
The only part of your code that I don't understand is the
Response.BinaryWrite(scan.Document)
Could you tell me what that does? I've copy the code without it and it works anyway.
Regards,
Briega
Sorry I typed wrong!
What I don't understand is:
Response.ContentType = scan.ContentType
Briega
I'm sorry, I took a little snippet out of my code. scan is an instantiation of a custom made class which retrieves the binary data and it's accompanying contenttype (pdft, excell, word, ...)
You can search for the content types on the internet.
Grz, Kris.
Labels:
addheader,
asp,
attachmentfilename,
clienttry,
code,
content-disposition,
dim,
download,
downloaded,
files,
folder,
form,
html,
net,
response,
strfilename
Subscribe to:
Posts (Atom)