Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
812 views
in Technique[技术] by (71.8m points)

how to pass encrypted query string in asp.net

I need to pass values between asp.net pages. How do i encrypt those values in the URL? Example : Response.Redirect("customerAdd.aspx?customerId=" + custId);

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Check out Mads Kristensen's article for an HttpModule that will encrypt/decrypt all of your querystrings. http://madskristensen.net/post/httpmodule-for-query-string-encryption

His code uses an HttpModule to parses outgoing HTML to encrypt and replace all relative path querystrings. The HttpModule also captures incoming requests and rewrites the request url to use an unencrypted querystring.

The nice part is that you can drop in the module and your code doesn't need to know when the querystrings are encrypted or not. From the code perspective, querystrings work like they always do.

We've been using it for over five years now and it works great.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...