小编nub*_*ubm的帖子

EF4 VS 2010 RTM中的EntityConfiguration在哪里?

我找不到EntityConfiguration.

RC的同样问题在这里,但我认为它将成为RTM版本.它在那里吗?

entity-framework visual-studio-2010 code-first

13
推荐指数
1
解决办法
4980
查看次数

如何使用Html.ActionLink本地化文本

我有像这样本地化的文本

<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)

(这不起作用,因为链接变成了一个字符串)
或者我必须将段落分成两部分吗?

c# asp.net localization razor asp.net-mvc-3

9
推荐指数
1
解决办法
3442
查看次数

Visual Studio 2012 XAML Designer垂直拆分不能设置为默认值?

是否仅Horizontal Split作为默认值而不是Vertical Split?再一次,还是我的眼睛变坏了?这是VS2008和VS2010中的一个问题,当它是基于每个文件时所以没有任何改变?

xaml xaml-designer visual-studio-2012

5
推荐指数
1
解决办法
932
查看次数

编辑不适用于Html.DropDownList和@class属性

控制器:

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)

asp.net asp.net-mvc razor asp.net-mvc-3

4
推荐指数
1
解决办法
2136
查看次数

如何在TFS 2010中编辑.sln文件?

我需要从解决方案文件(.sln)中删除几行.更改.csproj文件时,我可以使用"卸载项目".但是在TFS中编辑.sln文件的正确方法是什么?

tfs visual-studio-2010 tfs2010

2
推荐指数
1
解决办法
4285
查看次数