471,316 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

PostBackUrl cannot work for file link.

ABC
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?
Nov 19 '05 #1
6 6295
What are you trying to do?
Patrick

"ABC" <abc.abc.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
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?

Nov 19 '05 #2
ABC
I want to write download file link which filename retrieved from database
field.
"Patirck Ige" <na********@hotmail.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
What are you trying to do?
Patrick

"ABC" <abc.abc.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
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?


Nov 19 '05 #3
Where do you ge the error?
Any errors?

"ABC" <abc.abc.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I want to write download file link which filename retrieved from database
field.
"Patirck Ige" <na********@hotmail.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
What are you trying to do?
Patrick

"ABC" <abc.abc.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
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?



Nov 19 '05 #4
ABC
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" <na********@hotmail.com> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Where do you ge the error?
Any errors?

"ABC" <abc.abc.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I want to write download file link which filename retrieved from database
field.
"Patirck Ige" <na********@hotmail.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
> What are you trying to do?
> Patrick
>
> "ABC" <abc.abc.com> wrote in message
> news:Ot**************@TK2MSFTNGP12.phx.gbl...
>> 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?
>>
>>
>
>



Nov 19 '05 #5
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
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?

Nov 19 '05 #6
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:Ot**************@TK2MSFTNGP12.phx.gbl...
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?

Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by KBuser | last post: by
reply views Thread by wendylau81 | last post: by
reply views Thread by Wendy | last post: by
4 posts views Thread by sck10 | last post: by
1 post views Thread by Chris | last post: by
1 post views Thread by =?Utf-8?B?Sm9l?= | last post: by
4 posts views Thread by Nathan Sokalski | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.