473,395 Members | 1,774 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,395 software developers and data experts.

Hyperlink in a griddview

107 100+
Hope any one of can solve my problem. I have hyperlink button in a gridview in a templete column.Hyperlink represents the uploaded file. On Clicking the hyperlink it will open a dialouge box for downloading that file.

IT is not compulsory that it will be a hyperlink ...according to ur suitable way u can suggest what i have to use.
Aug 1 '07 #1
11 1355
giveDsolution
107 100+
It is So Confusing or wht ........no respond at all
Aug 1 '07 #2
prabunewindia
199 100+
hi friend,
acually where is that uploaded file?
in database or in system?
in database means in which format u stored it?
reply
i can guide u to solve it
Prabu

Hope any one of can solve my problem. I have hyperlink button in a gridview in a templete column.Hyperlink represents the uploaded file. On Clicking the hyperlink it will open a dialouge box for downloading that file.

IT is not compulsory that it will be a hyperlink ...according to ur suitable way u can suggest what i have to use.
Aug 1 '07 #3
giveDsolution
107 100+
hi friend,
acually where is that uploaded file?
in database or in system?
in database means in which format u stored it?
reply
i can guide u to solve it
Prabu
In Database .......Actually I have found the solution anyways u told me the solution ......may that will be a better one
Aug 1 '07 #4
prabunewindia
199 100+
store the file as byte[]

get that from database and code

response.AddHeader("Content-Disposition", "attachment;filename=" + dr["Flname"]);
response.ContentType = Convert.ToString(dr["ContentType"]);
Int32 b2 = Convert.ToInt32(dr["ContentSize"]);
response.OutputStream.Write(((byte[])(dr["Contents"])), 0, b2);

this will show u the dialog window
plz share ur solution
Prabu

In Database .......Actually I have found the solution anyways u told me the solution ......may that will be a better one
Aug 1 '07 #5
giveDsolution
107 100+
store the file as byte[]

get that from database and code

response.AddHeader("Content-Disposition", "attachment;filename=" + dr["Flname"]);
response.ContentType = Convert.ToString(dr["ContentType"]);
Int32 b2 = Convert.ToInt32(dr["ContentSize"]);
response.OutputStream.Write(((byte[])(dr["Contents"])), 0, b2);

this will show u the dialog window
plz share ur solution
Prabu

I knew it but how to use it in hyperlink........I have used this one in Linkbutton
Aug 1 '07 #6
prabunewindia
199 100+
u can target another page using this hyperlink and pass the fileID(table primaryley value) using query string
then u get the file from that page's page load event and code to download

Prabu

I knew it but how to use it in hyperlink........I have used this one in Linkbutton
Aug 1 '07 #7
giveDsolution
107 100+
Without using another page we can do it like this....

I have use the linkbutton.
In aspx i have write
<asp:LinkButton ID="lbtn" runat="server" Text='<%#Databinder.Eval(container.Dataitem,"vchfi lename") %>' CommandName="cmdclick" ></asp:LinkButton>

In vb,

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs ) Handles GridView1.RowCommand
If e.CommandName = "cmdclick" Then
Dim strLink, strUserID As String
strLink = CType(CType(CType(e.CommandSource, LinkButton).Parent, DataControlFieldCell).Parent, GridViewRow).RowIndex
strUserID = GridView1.DataKeys(strLink).Value.ToString
Dim strsql = "SELECT * from T_Collaboration where vchCollaborationId='" & strUserID & "' and intDeletedStatus<>1"
Dim dr = comm.ExeReader("ConnectionString", strsql)
If dr.Read() Then
Dim length = dr("intFilesize").ToString()
Dim filename = dr("vchFilename").ToString()
Dim Data = CType(dr("imgFile"), Byte())
Dim Type = dr("vchFiletype").ToString
Response.AddHeader("Content-Disposition", "Attachment;Filename=" & filename)
Response.AddHeader("Content-Length", length)
Response.ContentType = Type
Response.BinaryWrite(Data)
Response.End()
End If
End If
End Sub


Is it ok???????
Aug 1 '07 #8
giveDsolution
107 100+
Frds any help???????????
This is working fine in Internet Explorer 7.0 but not working in IE 6.0.
Any guess wht may be the prob?
In IE6.0 when i click the linkbutton....it goes on thrill but it works in IE 7.0.
Plz help me frds
Aug 1 '07 #9
giveDsolution
107 100+
Seems difficult or wht?????? No Reply
Aug 1 '07 #10
giveDsolution
107 100+
Seems difficult or wht?????? No Reply

Till now i didn't find any solution
Aug 2 '07 #11
giveDsolution
107 100+
hellossssssss frds any idea plz
Aug 3 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Badboy36 | last post by:
Hello user from googlegroups, i made a microsoft access database with front and backend. i created the backend in microsoft access97. for the frontend i made two versions (one for microsoft...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
9
by: Leon | last post by:
What Am I Doing Wrong? Code Will Not Run, I Can't See The Error! Thanks. <asp:datalist id="DataList1" runat="server" RepeatColumns="4"> <ItemTemplate> <asp:HyperLink id=HyperLink1 ImageUrl=...
10
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
8
by: Nathan Sokalski | last post by:
I have several System.Web.UI.WebControls.HyperLink Controls which I want to display as rollover images. I know how to make these manually using the <a> and <img> tags or the <a> tag and a...
20
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is...
10
by: sierra7 | last post by:
I'm trying to create a form where a user enters a document reference number and then clicks a command button to add a hyperlink to the document, via a file picker. Thanks to Adezii's excellent...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.