I am getting an error when running
string quote = Page.RouteData.Values["quote"].ToString() ?? string.Empty;
Error: Object reference not set to an instance of an object.
I understand that ToString is causing the error since the Page.RouteData.Values[“quote”] is empty/null.
How do I check to see if the Page.RouteData.Values[“quote”] has a value before we do the ToString?
How about:
or