Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing values from datagrid link to another page

Status
Not open for further replies.

mikemardon

Programmer
May 23, 2005
71
GB
Hi there

I have a file upload hyperlink which is in the last column of my datagrid and I need to find out how to pass the corresponding stockID value (stored in the databound collection) to another page when the user clicks on it.

I am guessing that I need to do this in the HTML code but not sure how to go about it!

here is my current code for this link :

<asp:HyperLink id="HyperLink1" runat="server" Font-Size="XX-Small">upload spec</asp:HyperLink>

It does not have an onclick event but I guess I could add on using attributed.add?

Any help would be much appreciated

Thanks!
 
Try using a HyperLinkColumn instead


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
thanks for the guidance, however, when I set the URL Field to the corresponding field containing the URL I cannot click on the hyperlink!

If I right-click and choose 'save as' it works though!

Any ideas?

Thanks again
 
What URL has been generated for the link?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Looks as though you are not setting the URL correctly then if it's pointing to a file rather than a URL.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
it is supposed to point to this file!

like I said, it works fine if I r/c then choose save as!

????
 
I don't understand. Why would you want to create a Hyperlink that points to a file on the user's machine?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I just had it located there for testing, I have now moved it to a proper URl and it now works when I click on it, but there is not a prompt to save the file, it just displays the contents on screen.

I know I have to change the manner in which the file is interpreted by the browser but not sure how - any idea?

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top