i was trying to create an list but i cant style it by id or class is there any thing i should know about razor.. Can razor block stylings and how can i give a style to this element that will be filled with razor.
also i wanna make this list as dropdown(i dont wanna make a normal dropdown i wanna use ul element with style). its gonna show only a caption when mouse is over it, it should expand so how can i do it?
@using (Html.BeginForm("Create", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@Html.ValidationSummary(true)
<table>
<tr>
<td></td><td></td>
<td colspan="2">
<div class="editor-label">Product</div>
<div id="d1" class="editor-field">
<input id="iProduct" type="text" />
<input id="ProductSub" type="button" style="padding:5px; margin-top:15px;" value="Add New Product" onclick="productsub()"/>
@foreach (var Product in (new SelectList((System.Collections.IEnumerable)ViewData["Productlist"], "id", "name")))
{
<ul id="nanik">
<li id="@Product.Value">@Product.Text</li>
</ul>
}
</div>
</td>
Also if u can tell me if u know how to turn it into dropdown that would be awesome..
I suggest that you open the web page with Google Chrome or Firefox with Firebug installed and use their Inspect element to see why the CSS is not used for styling the list. I’m guessing that some other CSS code has overridden your list styling.