我找不到EntityConfiguration.
RC的同样问题在这里,但我认为它将成为RTM版本.它在那里吗?
我有像这样本地化的文本
<p>Please enter your user name and password. @Html.ActionLink(@Resources.Register, "Register") if you don't have an account. </p>
Run Code Online (Sandbox Code Playgroud)
通常在文本中有一个ActionLink.
我可以在整个ActionLink中使用{0}之类的东西
@string.Format(Resources.LogOn_Enter_Message, Html.ActionLink(@Resources.Register, "Register"))
Run Code Online (Sandbox Code Playgroud)
(这不起作用,因为链接变成了一个字符串)
或者我必须将段落分成两部分吗?
是否仅Horizontal Split作为默认值而不是Vertical Split?再一次,还是我的眼睛变坏了?这是VS2008和VS2010中的一个问题,当它是基于每个文件时所以没有任何改变?
控制器:
ViewBag.Category = new SelectList(this.service.GetAllCategories(), product.Category);
Run Code Online (Sandbox Code Playgroud)
我没有使用Id + Name.GetAllCategories()只返回几个int数.
当我在视图中使用时:
@Html.DropDownList("Category", String.Empty)
Run Code Online (Sandbox Code Playgroud)
一切正常.编辑正常,DropDownList显示所选值.HTML结果:
<select id="Category" name="Category">
<option value=""></option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option selected="selected">5</option>
...
</select>
Run Code Online (Sandbox Code Playgroud)
但我需要使用css @class,所以我使用这段代码:
@Html.DropDownList("Category", (IEnumerable<SelectListItem>)ViewBag.Category, new { @class = "anything" })
Run Code Online (Sandbox Code Playgroud)
HTML结果:
<select class="anything" id="Category" name="Category">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
...
</select>
Run Code Online (Sandbox Code Playgroud)
不幸的是,编辑仍然有效(我可以保存我选择的值),但DropDownList开始显示默认值而不是数据库中保存的值.
你有什么想法会有什么问题吗?
更新 我做了更新更准确.
GetAllCategories方法如下所示:
public List<int> GetAllCategories()
{
List<int> categories = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
return categories; …Run Code Online (Sandbox Code Playgroud) 我需要从解决方案文件(.sln)中删除几行.更改.csproj文件时,我可以使用"卸载项目".但是在TFS中编辑.sln文件的正确方法是什么?
asp.net ×2
razor ×2
asp.net-mvc ×1
c# ×1
code-first ×1
localization ×1
tfs ×1
tfs2010 ×1
xaml ×1