Connecting Tech Pros Worldwide Help | Site Map

PostBackUrl cannot work for file link.

ABC
Guest
 
Posts: n/a
#1: Nov 19 '05
I write the code as:
<asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
PostBackUrl='file://<%# Eval("path") %>' runat="server"></asp:LinkButton>

But It don't work to download or open file when I clicked.



How should I do?


Patirck Ige
Guest
 
Posts: n/a
#2: Nov 19 '05

re: PostBackUrl cannot work for file link.


What are you trying to do?
Patrick

"ABC" <abc.abc.com> wrote in message
news:Ot1aOKuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=blue]
> I write the code as:
> <asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
> PostBackUrl='file://<%# Eval("path") %>' runat="server"></asp:LinkButton>
>
> But It don't work to download or open file when I clicked.
>
>
>
> How should I do?
>
>[/color]


ABC
Guest
 
Posts: n/a
#3: Nov 19 '05

re: PostBackUrl cannot work for file link.


I want to write download file link which filename retrieved from database
field.


"Patirck Ige" <naijacoder@hotmail.com> wrote in message
news:Oj4biWuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=blue]
> What are you trying to do?
> Patrick
>
> "ABC" <abc.abc.com> wrote in message
> news:Ot1aOKuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=green]
>> I write the code as:
>> <asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
>> PostBackUrl='file://<%# Eval("path") %>' runat="server"></asp:LinkButton>
>>
>> But It don't work to download or open file when I clicked.
>>
>>
>>
>> How should I do?
>>
>>[/color]
>
>[/color]


Patirck Ige
Guest
 
Posts: n/a
#4: Nov 19 '05

re: PostBackUrl cannot work for file link.


Where do you ge the error?
Any errors?

"ABC" <abc.abc.com> wrote in message
news:%230ejCbuyFHA.2924@TK2MSFTNGP15.phx.gbl...[color=blue]
> I want to write download file link which filename retrieved from database
> field.
>
>
> "Patirck Ige" <naijacoder@hotmail.com> wrote in message
> news:Oj4biWuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=green]
> > What are you trying to do?
> > Patrick
> >
> > "ABC" <abc.abc.com> wrote in message
> > news:Ot1aOKuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=darkred]
> >> I write the code as:
> >> <asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
> >> PostBackUrl='file://<%# Eval("path") %>'[/color][/color][/color]
runat="server"></asp:LinkButton>[color=blue][color=green][color=darkred]
> >>
> >> But It don't work to download or open file when I clicked.
> >>
> >>
> >>
> >> How should I do?
> >>
> >>[/color]
> >
> >[/color]
>
>[/color]


ABC
Guest
 
Posts: n/a
#5: Nov 19 '05

re: PostBackUrl cannot work for file link.


I browsing from the server. no error message showed. When I clicked the
link, no response, no file open or download.

The source code from browser showed as:

<table cellspacing="0" cellpadding="2" border="0"
id="GViewDocumentSearchResult"
style="color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;width:100%;border-collapse:collapse;">
<tr style="background-color:Tan;font-weight:bold;">
<th scope="col">&nbsp;</th>
</tr><tr>
<td>
<a
id="GViewDocumentSearchResult_ctl02_HyperLink2"
href="file://c:\docs\mcgraw.hill.osborne.media.microsoft.sql.se rver.2005.new.features.txt"
target="_blank">Table of Contents</a>
(<span
id="GViewDocumentSearchResult_ctl02_LblSize">69425 91</span> Bytes)<br />
<span
id="GViewDocumentSearchResult_ctl02_Label2">Back Cover. Get full details on
all the innovative features and benefits available in the upcoming release
of SQL Server 2005. This authoritative guide explains the new and improved
enterprise data management capabilities, developer functions, and business
intelligence tools. Youâ?Tll see how the new release offers enhanced
scalability, availability, and security, as well as ease-of-use. Written by
the Senior Technical Editor of SQL Server Magazine, this is an ideal
resource for decis</span><br />
<a
id="GViewDocumentSearchResult_ctl02_HyperLink1"
href="file://c:\docs\mcgraw.hill.osborne.media.microsoft.sql.se rver.2005.new.features.txt"
target="_blank">c:\pcmsdocs\mcgraw.hill.osborne.me dia.microsoft.sql.server.2005.new.features.chm</a><br
/>
</td>
</tr><tr style="background-color:PaleGoldenrod;">
<td>
<a
id="GViewDocumentSearchResult_ctl03_HyperLink2"
href="file://c:\docs\oreilly.essential.business.process.modelin g.2005.txt"
target="_blank">Y</a>
(<span
id="GViewDocumentSearchResult_ctl03_LblSize">40687 14</span> Bytes)<br />
<span
id="GViewDocumentSearchResult_ctl03_Label2">Index . SYMBOL. A. B. C. D. E. F.
G. H. J. K. L. M. N. O. P. Q. R. T. U. V. W. X. Y. abstract processes. 2nd.
abstractProcess attribute. action activity. actions, pi-calculus and.
activities. automated. BPDM and. BPEL and. 3rd. BPML processes and. BPMN
and. BPRI and. branching. canceling. compensation and. dead path
elimination. defined. forking. insurance claims processing example. looping
and. merging conditional paths. milestones and. multiple instances of.
activity control category (WAPI). </span><br />
<a
id="GViewDocumentSearchResult_ctl03_HyperLink1"
href="file://c:\docs\oreilly.essential.business.process.modelin g.2005.txt"
target="_blank">c:\pcmsdocs\oreilly.essential.busi ness.process.modeling.aug.2005.chm</a><br
/>
</td>
</tr><tr>
<td>
<a
id="GViewDocumentSearchResult_ctl04_HyperLink2"
href="file://c:\docs\wrox.press.beginning.asp.net.2.0.databases .beta.preview.mar.2005.txt"
target="_blank">untitled</a>
(<span
id="GViewDocumentSearchResult_ctl04_LblSize">66998 59</span> Bytes)<br />
<span
id="GViewDocumentSearchResult_ctl04_Label2">Beginn ing ASP.NET 2.0 Databases
Beta Preview TEAM LinG -Live, Informative, Non-cost and Genuine !. TEAM
LinG -Live, Informative, Non-cost and Genuine !. Beginning ASP.NET 2.0
Databases Beta Preview John Kauffman with Thiru Thangarathinam TEAM
LinG -Live, Informative, Non-cost and Genuine !Beginning ASP.NET 2.0
Databases Beta Preview Published by Wiley Publishing, Inc. 10475 Crosspoint
Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2005 by Wiley
Publishing, Inc. Indianapolis</span><br />
<a
id="GViewDocumentSearchResult_ctl04_HyperLink1"
href="file://c:\docs\wrox.press.beginning.asp.net.2.0.databases .beta.preview.mar.2005.txt"
target="_blank">c:\pcmsdocs\wrox.press.beginning.a sp.net.2.0.databases.beta.preview.mar.2005.ebook-ling.pdf</a><br
/>
</td>
</tr>
</table>




"Patirck Ige" <naijacoder@hotmail.com> wrote in message
news:uiUxemuyFHA.3812@TK2MSFTNGP09.phx.gbl...[color=blue]
> Where do you ge the error?
> Any errors?
>
> "ABC" <abc.abc.com> wrote in message
> news:%230ejCbuyFHA.2924@TK2MSFTNGP15.phx.gbl...[color=green]
>> I want to write download file link which filename retrieved from database
>> field.
>>
>>
>> "Patirck Ige" <naijacoder@hotmail.com> wrote in message
>> news:Oj4biWuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=darkred]
>> > What are you trying to do?
>> > Patrick
>> >
>> > "ABC" <abc.abc.com> wrote in message
>> > news:Ot1aOKuyFHA.3864@TK2MSFTNGP12.phx.gbl...
>> >> I write the code as:
>> >> <asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
>> >> PostBackUrl='file://<%# Eval("path") %>'[/color][/color]
> runat="server"></asp:LinkButton>[color=green][color=darkred]
>> >>
>> >> But It don't work to download or open file when I clicked.
>> >>
>> >>
>> >>
>> >> How should I do?
>> >>
>> >>
>> >
>> >[/color]
>>
>>[/color]
>
>[/color]


Brock Allen
Guest
 
Posts: n/a
#6: Nov 19 '05

re: PostBackUrl cannot work for file link.


PostBackUrl is for cross page postbacks. If you want a link to do a download
of a file form your database, I'd suggest writing a handler (say .ashx file)
to do the load from your database. Then all your link needs to be is a standand
<a> to the ashx file.

-Brock
DevelopMentor
http://staff.develop.com/ballen
[color=blue]
> I write the code as:
> <asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
> PostBackUrl='file://<%# Eval("path") %>'
> runat="server"></asp:LinkButton>
> But It don't work to download or open file when I clicked.
>
> How should I do?
>[/color]


Bruce Barker
Guest
 
Posts: n/a
#7: Nov 19 '05

re: PostBackUrl cannot work for file link.


the binding expression (<%# %>) to be the only value in a attribute, or it
won't be detected as a binding expression and will be treated as a string
value. try:

<asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
PostBackUrl='<%# "file://" + Eval("path") %>' runat="server" />

also be sure you call DataBind(), so binding is performed.

-- bruce (sqlwork.com)


"ABC" <abc.abc.com> wrote in message
news:Ot1aOKuyFHA.3864@TK2MSFTNGP12.phx.gbl...[color=blue]
>I write the code as:
> <asp:LinkButton ID="LinkButton2" Text='<%# Eval("Title") %>'
> PostBackUrl='file://<%# Eval("path") %>' runat="server"></asp:LinkButton>
>
> But It don't work to download or open file when I clicked.
>
>
>
> How should I do?
>
>[/color]


Closed Thread