Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to pass negative number in the action but in the address bar i do not want negative number to display.
This negative number is value for an enum.
mydomain.com/myprojects/Days/Index/0
mydomain.com/myprojects/Days/Index/-3

What I have tried:

Currently I am passing negative int value of enum
Posted
Updated 18-Feb-19 5:56am
Comments
F-ES Sitecore 18-Feb-19 9:32am    
If you don't want the data to appear on the url then you'll need to use a POST, but that means you won't be able to link direct to your page.

https://forums.asp.net/post/5825782.aspx
Karthik_Mahalingam 18-Feb-19 23:48pm    
show your enum definition

1 solution

I think you have design issues, and should get rid of the "negative" enums. Refactor if necessary.

There is no advantage to negative enums. The only "standard" I would expect would be a default of "0" for "Unknown" or "Default".

The fact you have to even think about how to handle it shows it's a design error (from the norm).
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900