Generate a unique ID for each page of my application

  • Thread starter Thread starter Alphapage
  • Start date Start date
A

Alphapage

Hello,

I want to generate a unique ID for each page of my Asp.Net application.
My first step is to generate a new Guid when the page is loaded for the
first time and registers, stores this new Guid in a Dictionary which is saved
in the ApplicationState, then I add a hidden field to the page __PageID, so
I can get this unique ID on other Postbacks. No problem.

The problem is about hackers. They can modify my hidden field to another Guid.
What other parameters can I add to have a perfect unique ID per page ?
(I was thinking about computer info or IP address)

Thanks in advance for your help.
 
store the guid in viewstate as this is encrypted and validated.

-- bruce (sqlwork.com)
 
Hello Alphapage,

I'd rely on hashcode. Just render your page into string and get hashcode
from this string, and your can even encode it

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


A> Hello,
A>
A> I want to generate a unique ID for each page of my Asp.Net
A> application.
A> My first step is to generate a new Guid when the page is loaded for
A> the
A> first time and registers, stores this new Guid in a Dictionary which
A> is saved
A> in the ApplicationState, then I add a hidden field to the page
A> __PageID, so
A> I can get this unique ID on other Postbacks. No problem.
A> The problem is about hackers. They can modify my hidden field to
A> another Guid.
A> What other parameters can I add to have a perfect unique ID per page
A> ?
A> (I was thinking about computer info or IP address)
A> Thanks in advance for your help.
A>
 
So what ? We don't know what you are using those IDs for ? So I have no idea
what would be the consequence if a hacker was changing this value. You can
always check server side against your dictionary to find out changed values.

Your best bet is likely to start by telling us what is the overall goal for
those unique ids...
 
Back
Top