How to make Linkbuttons show visited status accurately?

G

Guest

I have a page that I get to by selecting the part number and serial number of
an item in my database. The pages then generates a set of files. Some of
these files have unique names (containing part/serial data within the name)
and others of these files (for historical/hysterical reasons) always have the
same name (regardless of which item they are for). Basically, all of these
files are generated from the database and provide the information in various
formats.

The problem is that on this last page, once I have visited the links
(displayed the files) for one item (part and serial), that link always shows
as
"visited"--even for other items.

I am using ASP.NET and using a "LinkButton" to generate the links. So, what
the browser sees is something like: "javascript:__doPostBack('Format1','')".
(Where "Format1" is the "id" of the LinkButton.). So, is there a way I can
get the Part and Serial number into some text somewhere so that the browser
recognizes the link as different when it is pointing to a file that really is
different?

The fact of the matter is that on the server, the file is given a name with
the part and serial number appended to the name and then downloaded with
"Response.OutputStream.Write" and set up so the client only sees the base
file name. (Really cool, BTW!--except that the links have this problem with
"visited" status being wrong).

To summarize, I want the displayed LinkButton (as seen by the browser) to be
something like "javascript:__doPostBack('Format1','PN1005_SN2465')" where the
'PN1005_SN2465' is the unique part and serial number identifying my item and
the user still only sees a link to "Format1.txt" or some such. Is there a
way to make that work? I've tried putting commented stuff into the link text
setting other attributes of the <asp:LinkButton ...> tag to contain the part
and serial number but one way or another, it never worked. Ideas?
Suggestions?

Thanks in advance!!

Lowell
 
M

MWells

The easy way would be to use a Hyperlink instead of a LinkButton. Setup a
separate page do the file access / generation, and then link to it from your
main product page. In this way, you can avoid the javascript-based Urls and
make them as distinct as you want for the browser's benefit.

So your actual linked Url would be something like;

http://yoursite.com/products/file1.aspx?sn=PN1005_SN2465

By playing with the querystring, you get the precise degree of Url namespace
control you want.

You might also look at "Url rewriting" as a technique to make the individual
Urls unique and more aesthetic, as in;

http://yoursite.com/products/PN1005_SN2465.aspx

/// M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top