473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Generate a unique ID for each page of my application

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.
Mar 12 '08 #1
6 4333
How about, perhaps, the HashCode of the Page?
--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"Alphapage" wrote:
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.
Mar 12 '08 #2
store the guid in viewstate as this is encrypted and validated.

-- bruce (sqlwork.com)
"Alphapage" wrote:
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.
Mar 12 '08 #3
All 10,000 pages? ;-)

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:9F**********************************@microsof t.com...
store the guid in viewstate as this is encrypted and validated.

-- bruce (sqlwork.com)
"Alphapage" wrote:
>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.
Mar 12 '08 #4
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
AHello,
A>
AI want to generate a unique ID for each page of my Asp.Net
Aapplication.
AMy first step is to generate a new Guid when the page is loaded for
Athe
Afirst time and registers, stores this new Guid in a Dictionary which
Ais saved
Ain the ApplicationState, then I add a hidden field to the page
A__PageID, so
AI can get this unique ID on other Postbacks. No problem.
AThe problem is about hackers. They can modify my hidden field to
Aanother Guid.
AWhat other parameters can I add to have a perfect unique ID per page
A?
A(I was thinking about computer info or IP address)
AThanks in advance for your help.
A>
Mar 12 '08 #5
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...

--
Patrice

"Alphapage" <Al*******@discussions.microsoft.coma écrit dans le message de
news: A4**********************************@microsoft.com...
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.

Mar 13 '08 #6
Thank you everyone,

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

Regards.

Mar 13 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mullin | last post by:
I need to generate a unique no. in the format like yyyymmddxxxxxx (xxxxxx 6-digitl running number) I think of create a table with two columns date value 20050405 120 20050406 99...
10
by: Mamuninfo | last post by:
Hello, Have any function in the DB2 database that can generate unique id for each string like oracle, mysql,sybase,sqlserver database. In mysql:- select md5(concat_ws("Row name")) from...
1
by: hikums | last post by:
I am posting this here, just in case anyone may need this. Step 1: CREATE SEQUENCE ID_SEQ START WITH 1050000 INCREMENT BY 1 MAXVALUE 9999999 NO CYCLE NO CACHE ORDER
28
by: Nina | last post by:
I need to generate unique id for my application. Use system time to create id, which is the best fit, but I don't know how to do it. Please help. Thanks in advance for any input.
7
by: Dave Fowler | last post by:
I have a simple script that hides an image when you click on it. I think it would be cool to have that functionality for all pages I visit. Is there a way to set my browser settings to...
15
by: Ashish Khandelwal | last post by:
As MSDN is not giving us guarantee upon uniqueness of Hash Code, so could any one suggest me that how to generate a unique Hash Code for same string always, and generate different-2 Hash Code...
4
by: gaurav1983 | last post by:
i have to generate unique combinations of given number of digits entered by user eg: N=4 (0,1,2,3) output should be 0 1 2 3
1
by: situ | last post by:
Hi, I'm using DB2 V9 for windows I'm inserting records into DGTT from select statement; the problem is how to insert unique value for every row inserted. I tried using “generated always as”...
6
by: er | last post by:
hi, here's why i'm trying to do: header1.hpp namespace{ struct A{};} struct B1{ A a; }; header2.hpp namespace{ struct A{};}
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.