473,473 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 6884
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: KBuser | last post by:
I've been looking around for the proper syntax, and have only found one instance where it appeared somebody else was trying the same thing, but didn't post how they had achieved their desired...
0
by: wendylau81 | last post by:
We are currently using ASP.NET 2.0 to revamp one of our web applications. Let me try to briefly explain how each page is laid out... Usually within the page, there are 3 components... The...
1
by: Wendy | last post by:
I had previously posted this in inetserver.asp.components, I don't think that was the right place... anyways, here is a repost: We are currently using ASP.NET 2.0 to revamp one of our web...
0
by: Wendy | last post by:
We are currently using ASP.NET 2.0 to revamp one of our web applications. Let me try to briefly explain how each page is laid out... Usually within the page, there are 3 components... The header,...
4
by: sck10 | last post by:
Hello, Can you use the PostBackUrl to post to different sites? I have a page (PostBackURL.aspx' ) on one website (same server) that has a button set to: PostBackURL="http://zone1.web.com" ...
1
by: Chris | last post by:
Hi, i created an ImageButton within an ItemTemplate of a datalist (in shop.aspx). There are two possibilities: 1) when the user is logged and he clicks on an image, he must be 'postbacked' to...
2
by: noneya22 | last post by:
I'm using asp.net 2.0. I have a page that has a save button and a cancel button along with a text field. All controls are asp.net server controls. I have JavaScript that prompts the user if he...
1
by: =?Utf-8?B?Sm9l?= | last post by:
I have a page that has a drop down list that does a autopost back which brings up a datagrid. I then also have a button at the bottom that has a PostBackUrl property to go to another page. I...
4
by: Nathan Sokalski | last post by:
I have a Button that uses the PostBackUrl property which is inside a Repeater template. When I get to the Page that is being posted to (the one specified in PostBackUrl), I am having trouble...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.