473,666 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ApplicationStat e, 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 4344
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 ApplicationStat e, 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 ApplicationStat e, 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*********@di scussions.micro soft.comwrote in message
news:9F******** *************** ***********@mic rosoft.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 ApplicationStat e, 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 ApplicationStat e, 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*******@disc ussions.microso ft.coma écrit dans le message de
news: A4************* *************** **...icrosof t.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 ApplicationStat e, 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
3227
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 Everytime, the application will increase the value+1 based on the same
10
18588
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 tablename; Here this function generate unique id for each row of the table. Regards..
1
11244
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
17674
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
1617
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 automatically load that script with each page I visit?
15
37581
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 Different-2 string.
4
2841
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
2747
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” clause but its exhausting at some point of time. Say if 100000 records were needed to be processed, it’s only processing up to 60000 rows.
6
2029
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
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6192
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.