I'm using an HtmlHelper where I give table data id's based on day and month values which are retrieved. The problem is the id is not recognized in the format it's in. '/'
seems to not be picked up yet when I replace '/' with '-' it works.
daysRow.AppendFormat("<td id='{0}/{1}'>{0}</td>", day, d1.Month.ToString());
Can anyone tell me how to format this?
The problem is not with C#, but rather, with your using a '/' character in HTML. From the section of the HTML 4.0 spec on the id attribute:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
The '/' violates that rule, which is why you are seeing issues when using that, but not the '-' character.