I'm initializing a string and it's throwing a NullReferenceException:
string HTML =
"<div class=\"table-responsive formMOE\">" +
"<table class=\"table\">" +
"<thead class=\"white\"><tr><th>ID</th><th>Name</th><th>Type</th><th>Description</th><th>Ingredients</th><th>Price</th></tr></thead>" +
"<tbody data-link=\"row\" class=\"rowlink\">" +
"<tr>" +
"<td><a href=\"Products.aspx?ProductID=" + product.ProductID + "\"></a>" + product.ProductID +
"</td><td>" + product.Name +
"</td><td>" + product.Type +
"</td><td>" + product.Description +
"</td><td>" + product.Ingredients +
"</td><td>" + product.Price +
" <span class=\"fa fa-shekel\"></span></td><td>" +
"</td>" +
"</tr>" +
"</tbody></table></div>";
Even though I use this code:
string HTML =
"<div class=\"table-responsive formMOE\">" +
"<table class=\"table\">" +
"<thead class=\"white\"><tr><th>Name</th><th>Description</th><th>Price</th></tr></thead>" +
"<tbody data-link=\"row\" class=\"rowlink\">";
In another part and get no NullReferenceException.
I tried setting the string to a random value like "hi" and then setting it to the actual value I needed, didn't work.