TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Basit Khan
NA
336
121.8k
Datalist inside update panel linkbutton is not downloading f
Jul 31 2017 6:52 AM
Hi,
DataList Inside update panel linkbutton is not downloading file.
Below is my code
<asp:UpdatePanel ID=
"UpdatePanel1"
runat=
"server"
>
<ContentTemplate>
<asp:Panel runat=
"server"
ID=
"UpdatePanel1"
ChildrenAsTriggers=
"false"
>
<div style=
"vertical-align: middle; min-height: 480px;"
class=
"pre-scrollable"
>
<div>
<asp:DataList ID=
"DataList2"
runat=
"server"
p Font-Bold=
"False"
Font-Italic=
"False"
Font-Overline=
"False"
Font-Strikeout=
"False"
Font-Underline=
"False"
HorizontalAlign=
"Center"
RepeatLayout=
"Table"
>
<ItemTemplate>
<div>
<asp:Label ID=
"Label2"
runat=
"server"
Text=
'<%# Eval("FileName") %>'></asp:Label>
<asp:LinkButton ID=
"LinkButton1"
runat=
"server"
Text=
'<%# Eval("ImagePath") %>' OnClick="DownloadFile" CommandArgument='<%# Eval("Id")%>'></asp:LinkButton>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
Dim
fileName as
String
=
"D:\Image\1.jpg"
Response.Clear() Response.Buffer =
True
Response.Charset =
""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
'Response.ContentType = contentType Response.AppendHeader("Content-Disposition", Convert.ToString("attachment; filename=") & fileName) 'Response.BinaryWrite(bytes) Response.Flush() Response.[End]()
I try the following code but also no success
</ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="LinkButton1" /> </Triggers>
Reply
Answers (
2
)
when i am uploading .xls file in Asp.Net getting error:
ASp.netMVC Validations