473,218 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 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 6854
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.