Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to set a variable to the url of the previous page, however there is no previous page:
string url_prev = "";
if(!string.IsNullOrEmpty(Model.Content.Previous().Url))
{
url_prev = Model.Content.Previous().Url;
}
but this gives the following error:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
can anyone help?
cheers
Nic
this is your solution
if(Model.Content.Previous()!= null)) { url_prev = Model.Content.Previous().Url; }
perfect, thank you
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error when setting a variable to null
I am trying to set a variable to the url of the previous page, however there is no previous page:
string url_prev = "";
if(!string.IsNullOrEmpty(Model.Content.Previous().Url))
{
url_prev = Model.Content.Previous().Url;
}
but this gives the following error:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
can anyone help?
cheers
Nic
this is your solution
perfect, thank you
is working on a reply...