I have an issue with html attribute in a view.
here : [TEXT](https://myprettycms.codeplex.com/SourceControl/latest#MyPrettyCMSCommunityManager/Portals/MVC4Portal/Views/Shared/_MenuElement.cshtml)
```
<div class="EditMenuItem" title="@Resources.View_All_MenuEditor_Title"
data-language="@Model.Language.Language"
data-DirectURL="@Model.DirectURL"
data-id="@Model.Id"
data-LayoutMenuTranslationLayoutMenuParent="@Model.LayoutMenuTranslationLayoutMenuParent"
data-Ancestors="@Model.Ancestors"
>
</div>
```
@Model.LayoutMenuTranslationLayoutMenuParent is filled in the controller and when the parent menu is null, null is sent to the view rendering engine.
Look FillMenu and FillMenus in [TEXT](https://myprettycms.codeplex.com/SourceControl/latest#MyPrettyCMSCommunityManager/Layers/CommonLayer/Controllers/ViewControllers/LayoutViewControllers/LayoutViewControllersStaticTools.cs)
When the code is generated, null is replaced by 0.
Did you heard about that ?
Comments: I tried the simplified scenario as follows, and this does not reproduce. Here is the code and steps below. If you find another simplified scenario like that, that shows your issue please re-open the bug. Steps to reproduce: Create an MVC4 application. In the Home Controller add the following code: ``` public ActionResult MyModel() { var modelData = new MyModelData() { Data = null // replace with 0, to make 0 show up. }; return View(modelData); } ``` Create a view called MyModel.cshtml with the following code: ``` @{ ViewBag.Title = "MyModel"; } <h2>MyModel</h2> <fieldset> <legend>MyModelData</legend> </fieldset> <p> <div data-foo="@Model.Data">Model.Data = @Model.Data</div> </p> ``` and a model class with the following code: ``` public class MyModelData { public int? Data { get; set; } } ``` Compile the app, and browse to localhost:port/Home/MyModel When the model's "Data" is set to null, both the source html and the attribute on the div as well as the displayed html will show empty, when set to 0, 0 will show appropriately in the source and in the browser.
here : [TEXT](https://myprettycms.codeplex.com/SourceControl/latest#MyPrettyCMSCommunityManager/Portals/MVC4Portal/Views/Shared/_MenuElement.cshtml)
```
<div class="EditMenuItem" title="@Resources.View_All_MenuEditor_Title"
data-language="@Model.Language.Language"
data-DirectURL="@Model.DirectURL"
data-id="@Model.Id"
data-LayoutMenuTranslationLayoutMenuParent="@Model.LayoutMenuTranslationLayoutMenuParent"
data-Ancestors="@Model.Ancestors"
>
</div>
```
@Model.LayoutMenuTranslationLayoutMenuParent is filled in the controller and when the parent menu is null, null is sent to the view rendering engine.
Look FillMenu and FillMenus in [TEXT](https://myprettycms.codeplex.com/SourceControl/latest#MyPrettyCMSCommunityManager/Layers/CommonLayer/Controllers/ViewControllers/LayoutViewControllers/LayoutViewControllersStaticTools.cs)
When the code is generated, null is replaced by 0.
Did you heard about that ?
Comments: I tried the simplified scenario as follows, and this does not reproduce. Here is the code and steps below. If you find another simplified scenario like that, that shows your issue please re-open the bug. Steps to reproduce: Create an MVC4 application. In the Home Controller add the following code: ``` public ActionResult MyModel() { var modelData = new MyModelData() { Data = null // replace with 0, to make 0 show up. }; return View(modelData); } ``` Create a view called MyModel.cshtml with the following code: ``` @{ ViewBag.Title = "MyModel"; } <h2>MyModel</h2> <fieldset> <legend>MyModelData</legend> </fieldset> <p> <div data-foo="@Model.Data">Model.Data = @Model.Data</div> </p> ``` and a model class with the following code: ``` public class MyModelData { public int? Data { get; set; } } ``` Compile the app, and browse to localhost:port/Home/MyModel When the model's "Data" is set to null, both the source html and the attribute on the div as well as the displayed html will show empty, when set to 0, 0 will show appropriately in the source and in the browser.