Abhishek Sirari
Abhishek Sirari

Reputation: 35

'#' in aspx page parameter value creating issue

Whenever I am passing 2 parameters to an .aspx page with 1st parameter's value containing '#' then I am not able to fetch the value of the second parameter using "Request.Params["param1"]" in aspx.cs code.

Eg: When I hit the following URL (containing '#' in "assignmentname" parameter):

http://localhost/ReportingModule/summaryreport.aspx?assignmentname=School#College&submissionid=86900

then upon executing the code "Request.Params["submissionid"]", I don't get any value.

But when I hit the following URL (deleting the '#'):

http://localhost/ReportingModule/summaryreport.aspx?assignmentname=SchoolCollege&submissionid=86900

It works fine. Whats the problem?

Upvotes: 0

Views: 60

Answers (2)

Abhishek Sirari
Abhishek Sirari

Reputation: 35

I replaced '#' with '%23' and it worked!!

Upvotes: 1

Dhaval Patel
Dhaval Patel

Reputation: 7601

you can use encodeURIComponent for it like

link = encodeURIComponent(link);

Upvotes: 0

Related Questions