Generate a unique ID for each page of my application

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.
 
B

bruce barker

store the guid in viewstate as this is encrypted and validated.

-- bruce (sqlwork.com)
 
M

Michael Nemtsev [MVP]

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>
 
P

Patrice

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...
 
A

Alphapage

Thank you everyone,

I will build a custom Id with the hashcode. Great idea.

Regards.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top