Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > click to download

Reply
Thread Tools

click to download

 
 
Guest
Posts: n/a
 
      04-08-2007
Can I have this function?
When a user click on a link, my ASP page generates a text file call test.txt
containing a string of "This ia s test msg.", and then a download dialogue
appears.
Any reference for me?
Thanks in advance.

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      04-08-2007

<Elliot> wrote in message
news:(E-Mail Removed)...
> Can I have this function?
> When a user click on a link, my ASP page generates a text file call

test.txt
> containing a string of "This ia s test msg.", and then a download dialogue
> appears.
> Any reference for me?
> Thanks in advance.
>


How's this:-

<%
Response.CodePage = 950 ' Change to prefered codepage
Response.ContentType = "text/plain"
Response.CharSet = "big5" 'Change to Charset matching codepage
Response.AddHeader "attachment; filename=test.txt"
Response.Write "This is a test msg"
%>



 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      04-08-2007
Anthony, thanks a lot for your help.
I have tried it by adding your code to my empty ASP file, however, it
displayed an error 500 page. Did I do something wrong?

"Anthony Jones" <(E-Mail Removed)> wrote in message
news:uL#(E-Mail Removed)...
>
> <Elliot> wrote in message
> news:(E-Mail Removed)...
>> Can I have this function?
>> When a user click on a link, my ASP page generates a text file call

> test.txt
>> containing a string of "This ia s test msg.", and then a download
>> dialogue
>> appears.
>> Any reference for me?
>> Thanks in advance.
>>

>
> How's this:-
>
> <%
> Response.CodePage = 950 ' Change to prefered codepage
> Response.ContentType = "text/plain"
> Response.CharSet = "big5" 'Change to Charset matching codepage
> Response.AddHeader "attachment; filename=test.txt"
> Response.Write "This is a test msg"
> %>
>
>
>

 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      04-08-2007

<Elliot> wrote in message
news:(E-Mail Removed)...
> Anthony, thanks a lot for your help.
> I have tried it by adding your code to my empty ASP file, however, it
> displayed an error 500 page. Did I do something wrong?


IIS5 (Win2000) or IIS6 (Win2003)?

Edit your application configuration properties and enable detailed error ASP
error messages.
IIS Manager -> You application folder -> Propeties -> Home
Directory ->Configuration...-> App Debugging -> Send detailed ASP error
messages to client.

What do you get back now?
What is the system codepage of the server you are using?


>
> "Anthony Jones" <(E-Mail Removed)> wrote in message
> news:uL#(E-Mail Removed)...
> >
> > <Elliot> wrote in message
> > news:(E-Mail Removed)...
> >> Can I have this function?
> >> When a user click on a link, my ASP page generates a text file call

> > test.txt
> >> containing a string of "This ia s test msg.", and then a download
> >> dialogue
> >> appears.
> >> Any reference for me?
> >> Thanks in advance.
> >>

> >
> > How's this:-
> >
> > <%
> > Response.CodePage = 950 ' Change to prefered codepage
> > Response.ContentType = "text/plain"
> > Response.CharSet = "big5" 'Change to Charset matching codepage
> > Response.AddHeader "attachment; filename=test.txt"
> > Response.Write "This is a test msg"
> > %>
> >
> >
> >



 
Reply With Quote
 
Guest
Posts: n/a
 
      04-09-2007
IIS5.
How can I know the system codepage of my server?
The followings are the technical information.

Error Type:
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment:
'Response.AddHeader'
/test.asp, line 5


Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR
2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)

Page:
GET /test.asp




"Anthony Jones" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
>
> <Elliot> wrote in message
> news:(E-Mail Removed)...
>> Anthony, thanks a lot for your help.
>> I have tried it by adding your code to my empty ASP file, however, it
>> displayed an error 500 page. Did I do something wrong?

>
> IIS5 (Win2000) or IIS6 (Win2003)?
>
> Edit your application configuration properties and enable detailed error
> ASP
> error messages.
> IIS Manager -> You application folder -> Propeties -> Home
> Directory ->Configuration...-> App Debugging -> Send detailed ASP error
> messages to client.
>
> What do you get back now?
> What is the system codepage of the server you are using?
>
>
>>
>> "Anthony Jones" <(E-Mail Removed)> wrote in message
>> news:uL#(E-Mail Removed)...
>> >
>> > <Elliot> wrote in message
>> > news:(E-Mail Removed)...
>> >> Can I have this function?
>> >> When a user click on a link, my ASP page generates a text file call
>> > test.txt
>> >> containing a string of "This ia s test msg.", and then a download
>> >> dialogue
>> >> appears.
>> >> Any reference for me?
>> >> Thanks in advance.
>> >>
>> >
>> > How's this:-
>> >
>> > <%
>> > Response.CodePage = 950 ' Change to prefered codepage
>> > Response.ContentType = "text/plain"
>> > Response.CharSet = "big5" 'Change to Charset matching codepage
>> > Response.AddHeader "attachment; filename=test.txt"
>> > Response.Write "This is a test msg"
>> > %>
>> >
>> >
>> >

>
>

 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      04-10-2007

<Elliot> wrote in message
news:(E-Mail Removed)...
> IIS5.
> How can I know the system codepage of my server?
> The followings are the technical information.
>
> Error Type:
> Microsoft VBScript runtime (0x800A01C2)
> Wrong number of arguments or invalid property assignment:
> 'Response.AddHeader'
> /test.asp, line 5
>


That's my fault not being careful with the typing that line should read:-

Response.AddHeader "Content-Disposition", "attachment; filename=test.txt"


>
> Browser Type:
> Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR
> 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)
>
> Page:
> GET /test.asp
>



>
>
>
> "Anthony Jones" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> >
> > <Elliot> wrote in message
> > news:(E-Mail Removed)...
> >> Anthony, thanks a lot for your help.
> >> I have tried it by adding your code to my empty ASP file, however, it
> >> displayed an error 500 page. Did I do something wrong?

> >
> > IIS5 (Win2000) or IIS6 (Win2003)?
> >
> > Edit your application configuration properties and enable detailed error
> > ASP
> > error messages.
> > IIS Manager -> You application folder -> Propeties -> Home
> > Directory ->Configuration...-> App Debugging -> Send detailed ASP error
> > messages to client.
> >
> > What do you get back now?
> > What is the system codepage of the server you are using?
> >
> >
> >>
> >> "Anthony Jones" <(E-Mail Removed)> wrote in message
> >> news:uL#(E-Mail Removed)...
> >> >
> >> > <Elliot> wrote in message
> >> > news:(E-Mail Removed)...
> >> >> Can I have this function?
> >> >> When a user click on a link, my ASP page generates a text file call
> >> > test.txt
> >> >> containing a string of "This ia s test msg.", and then a download
> >> >> dialogue
> >> >> appears.
> >> >> Any reference for me?
> >> >> Thanks in advance.
> >> >>
> >> >
> >> > How's this:-
> >> >
> >> > <%
> >> > Response.CodePage = 950 ' Change to prefered codepage
> >> > Response.ContentType = "text/plain"
> >> > Response.CharSet = "big5" 'Change to Charset matching codepage
> >> > Response.AddHeader "attachment; filename=test.txt"
> >> > Response.Write "This is a test msg"
> >> > %>
> >> >
> >> >
> >> >

> >
> >



 
Reply With Quote
 
Guest
Posts: n/a
 
      04-10-2007
It works perfectly, Anthony. You help me a lot. Thanks again for your kindly
intention.


"Anthony Jones" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> <Elliot> wrote in message
> news:(E-Mail Removed)...
>> IIS5.
>> How can I know the system codepage of my server?
>> The followings are the technical information.
>>
>> Error Type:
>> Microsoft VBScript runtime (0x800A01C2)
>> Wrong number of arguments or invalid property assignment:
>> 'Response.AddHeader'
>> /test.asp, line 5
>>

>
> That's my fault not being careful with the typing that line should read:-
>
> Response.AddHeader "Content-Disposition", "attachment; filename=test.txt"
>
>
>>
>> Browser Type:
>> Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR
>> 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30)
>>
>> Page:
>> GET /test.asp
>>

>
>
>>
>>
>>
>> "Anthony Jones" <(E-Mail Removed)> wrote in message
>> news:#(E-Mail Removed)...
>> >
>> > <Elliot> wrote in message
>> > news:(E-Mail Removed)...
>> >> Anthony, thanks a lot for your help.
>> >> I have tried it by adding your code to my empty ASP file, however, it
>> >> displayed an error 500 page. Did I do something wrong?
>> >
>> > IIS5 (Win2000) or IIS6 (Win2003)?
>> >
>> > Edit your application configuration properties and enable detailed
>> > error
>> > ASP
>> > error messages.
>> > IIS Manager -> You application folder -> Propeties -> Home
>> > Directory ->Configuration...-> App Debugging -> Send detailed ASP error
>> > messages to client.
>> >
>> > What do you get back now?
>> > What is the system codepage of the server you are using?
>> >
>> >
>> >>
>> >> "Anthony Jones" <(E-Mail Removed)> wrote in message
>> >> news:uL#(E-Mail Removed)...
>> >> >
>> >> > <Elliot> wrote in message
>> >> > news:(E-Mail Removed)...
>> >> >> Can I have this function?
>> >> >> When a user click on a link, my ASP page generates a text file call
>> >> > test.txt
>> >> >> containing a string of "This ia s test msg.", and then a download
>> >> >> dialogue
>> >> >> appears.
>> >> >> Any reference for me?
>> >> >> Thanks in advance.
>> >> >>
>> >> >
>> >> > How's this:-
>> >> >
>> >> > <%
>> >> > Response.CodePage = 950 ' Change to prefered codepage
>> >> > Response.ContentType = "text/plain"
>> >> > Response.CharSet = "big5" 'Change to Charset matching codepage
>> >> > Response.AddHeader "attachment; filename=test.txt"
>> >> > Response.Write "This is a test msg"
>> >> > %>
>> >> >
>> >> >
>> >> >
>> >
>> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
click click click Andy Morrison Computer Support 7 12-20-2007 06:50 AM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
button click event being called twice on click mike parr ASP .Net 1 05-20-2004 04:02 PM
Datalist selects Item after first click, but does apply the SelectedItemTemplate after the second click only Dirk Meusel ASP .Net 1 08-19-2003 09:56 AM



Advertisments