Click here to Skip to main content
13,296,377 members (50,390 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 28 Jan 2014

ISD Code Customization Tips, Part III: Avoid Reading QueryString Directly

, 28 Jan 2014
Rate this:
Please Sign up or sign in to vote.
ISD Code Customization Tips, Part III: Avoid Reading QueryString Directly


ISD makes it trivial to implement URL parameter encryption. All you need to do is to tick a checkbox in application generation options. This is extremely helpful in scenarios when you need to turn on/off the functionality in the middle of your development. For example, your client requests to add URL encryption at the last minute before you are ready to release the application. Another scenario is that you had encryption turned on from the beginning of your project. In order to track a tricky bug, you turned encryption off temporarily. After the bug was fixed, you turned encryption back on.

However, if you read URL parameters directly in your customization code, like this:

string companyId = Page.Request.QueryString["CompanyId"];

you lose all the flexibility and convenience ISD provides. That's because ISD adds/removes encryption-related code only in auto generated section II. It does not touch custom code in section I. Therefore, it is your responsibility to switch on/off encryption in section I.


In order to read URL parameters in section I custom code without losing the encryption on/off flexibility, you can use URL( ) formula function, like this:

string companyId = EvaluateFormula("URL(\"CompanyId\")");

Formula function URL( ) automatically decrypts parameters if URL encryption is turned on. 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 28 Jan 2014
Article Copyright 2014 by dingjing
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid