How to Break Long String URLs
Querystrings are long URL values that contain values you use in your website. You "break" the URL values by calling the "Request" function. This function extracts the information from the URL values and lets you display a Web page based on the values in the URL string. Breaking the querystring values is accomplished in the "Page_Load" function in each of your Web pages.
Instructions
-
-
1
Click the Windows "Start" button and select "All Programs." Click "Microsoft .NET Framework," then click "Visual Studio" to open your programming software.
-
2
Double-click the website form you want to edit. In the drop-down box at the upper-right corner, choose "Page_Load" to scroll down directly to the location where you enter your code.
-
-
3
Create a variable that you assign the value of the querystring values. For instance, if your querystring contains a customer ID, use the code below:
"string customerId;"
-
4
Assign the querystring value to the variable. To break the URL and assign a value to a variable, use the following code:
"customerId = "Value= " + Request.QueryString["customerId"];"
-
5
Click the "Save" button at the top of your Visual Studio software. Click "Run" to compile and test your code.
-
1