There are many parameter passing methods between webpages. Today I am not talking about the number of parameters, but about using the most basic method to pass parameters. This is the most basic method for flexible use of parameter transfer. In fact, it can transmit very complex data.
For example, the initial date and the end date are obtained on page A, and then the parameters are set as follows:
TJ = "RQ> = '1970-01-01 'and RQ <= '1970-06-01 '"
The simplest way is to use the most basic parameter transfer method.
InCodeUse Page. registerclientscriptblock ("TJ", "<script language = JavaScript> window. Open ('B. aspx? Cs = "+ TJ +" ') </SCRIPT> ")
Use dim CS as string = request. querystring ("CS") on page B to obtain parameters.
Code "select * from TB where" + CS to use parameters
If this is the case, I will not discuss it here. In this case, a problem occurs. The "'" In the TJ parameter cannot be parsed, so the parameter cannot be passed like this. All must be escaped.
Change TJ to the following in VB.net:
TJ = "RQ >=\ '2017-01-01 \ 'and RQ <= \ '2017-06-01 \'"
In C #. net, change TJ to the following:
TJ = @ "RQ >=\ '2017-01-01 \ 'and RQ <= \ '2017-06-01 \'"
Using this method, you can construct and transmit very complex parameters, that is, the combination of multiple parameters.
Here is only to illustrate the problem. For example, if only two dates are passed, there may be other methods better.