Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

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

, 28 Jan 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
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 cl

Introduction

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.

Tip

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

License

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

Share

About the Author

dingjing

United States United States
No Biography provided

Comments and Discussions

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