I am getting an error of null
value in the following code in MVC asp.net
;
@Regex.Replace(Model.FullDescription, "<[^>]*>" ,"")
I am trying to replace any HTML
tag with empty string. In popup window it shows result correctly without HTML tags, but on page it is showing above null value error.
You are passing it a null
as its first parameter and it tells you in error message:
Value cannot be null.
Parameter name: input
Try to check it on error with null validation
@Regex.Replace(Model.FullDescription ?? "", "<[^>]*>" ,"")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With