Let’s say, I’ve got this.
<div id = "myDiv">
<% Html.RenderPartial("MyUserControl"); %>
</div>
and inside my partial view, I’ve got this.
<% = htm.TextBox("myTextBox")%>
How can I style this tag from my Site.css file under Content folder? For instance, I want the back ground color to be green.
Thanks for helping
I guess if I did not get an answer until now, it’s probably because I didn’t ask clearly my question. Anyway, after hours of struggling, I found out how to deal with this.
The following tag <% Html.RenderPartial(string); %> is just a placeholder. So when the page executes, everything is merged (Master page, the view itself, the partial page, etc.). That implies I can target any element anywhere from my external css file by just keeping in mind the real location of that element in the final document.
for instance,
inside mypartial view, i’ve got this,
I can access my input element this way:
Because, in reality, when the application executes, the whole document will present like this
Hope that I didn’t write falsehood.Otherwise correct me.
Thanks for helping.