By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,663 Members | 762 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,663 IT Pros & Developers. It's quick & easy.

How to make Linkbuttons show visited status accurately?

P: n/a
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

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.a...=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
"th****@community.nospam" <th*******************@discussions.microsoft.com >
wrote in message news:71**********************************@microsof t.com...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.