| |

VerySource

 Forgot password?
 Register
Search
View: 1467|Reply: 13

Request? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-27 23:00:01
| Show all posts |Read mode
Response.Redirect ("webform2.aspx? Aa = #&bb = 567");
In this way, you can get the values ​​of aa and bb in webform2
But Response.Redirect ("webform2.aspx? Aa = #&bb = #");
I can't get the value of bb in this way. How can I get the value of bb?
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-2-22 23:00:01
| Show all posts
Remove the # sign and try
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-2-23 00:45:01
| Show all posts
Response.Redirect ("webform2.aspx? Aa =" + Server.UrlEncode ("#") + "&bb ="
+ Server.UrlEnCode ("#");
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-2-23 02:30:01
| Show all posts
Request.QueryString ["bb"]
Did you write like this
Reply

Use magic Report

0

Threads

29

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-2-23 07:00:02
| Show all posts
Response.Redirect (Server.UrlEncode ("webform2.aspx? Aa = #&bb = #")); Try it
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-2-23 08:30:01
| Show all posts
The # sign indicates the anchor point in the url.
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-2-23 20:15:01
| Show all posts
#&This is not mistaken, it seems to be an escape character. #&13; charCode has a semantic problem
The last # is indeed the anchor
It is recommended not to use such weird parameters.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-2-23 23:00:01
| Show all posts
Use reflection to give you an example.




string sClass = CCConvert.GetRequsetQueryString ("ClassName");
string sMethodName = "GetReports";
// Get class
Type oType = System.Type.GetType ("Report.Class." + SClass);
if (oType == null)
{
Response.Write ("Class:" + sClass + "Does not exist!");
return;
}

// Implementation
object oInst = Activator.CreateInstance (oType);
if (oInst == null)
{
Response.Write ("Class:" + sClass + "Does not exist!");
return;
}
// Get method
MethodInfo oMethod = oType.GetMethod (sMethodName);

if (oMethod == null)
{
Response.Write ("Method:" + sMethodName + "Does not exist!");
return;
}
int iParamsCount = oMethod.GetParameters (). Length;
string sParams = CCConvert.GetRequsetQueryString ("Params");
string [] ary = sParams.Split (',');
if (ary.Length! = iParamsCount)
{
Response.Write (String.Format ("The number of passed parameters {0} is not equal to the actual number of parameters {1} of the method {2}, please check", ary.Length.ToString (), oMethod.Name , iParamsCount.ToString ()));
return;
}
// Get attributes
PropertyInfo Pro = oType.GetProperty ("Title");
Ranch


this.sTitle = Pro.GetValue (oInst, null) .ToString ();
Ranch
FieldInfo fldFileName = oType.GetField ("sExcelFileName");
Ranch
Ranch

string sHTML = oMethod.Invoke (oInst, BindingFlags.Public, Type.DefaultBinder, ary, null) .ToString ();
string sFileName = fldFileName.GetValue (oInst) .ToString ();
//Response.Write(sFileName);
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-2-24 08:45:01
| Show all posts
Sorry I sent it in the wrong place.
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-2-24 09:30:01
| Show all posts
Response.Redirect ("webform2.aspx? Bb = 567&aa = #");
Write like this
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list