问题描述
我有2个网站;一个是公共及其他为admin.These boith是独立的网站。
theSite.dll是公众和theSiteCMS的管理。
下code是AdminSite即theSiteCMS.This网站还包含theSite.dll引用其中也有相同的成员函数Html.ActiveLinkImage。
我怀疑,我不能够隔离这些调用;因此错误。
请说明正确的方式。
code theSiteCMS(管理站点)
&LT;%@页标题=LANGUAGE =C#的MasterPageFile =〜/查看/共享/的Site.Master Inherits=\"System.Web.Mvc.ViewPage<theSiteCMS.Helpers.Pagination<theSiteCMS.Models.Article>>\"%>&LT; ASP:内容ID =内容1ContentPlaceHolderID =TitleContent=服务器&GT;
文章管理
&LT; / ASP:内容&GT;&LT; ASP:内容ID =内容2ContentPlaceHolderID =日程地址搜索Maincontent=服务器&GT;
&LT;脚本类型=文/ JavaScript的LANGUAGE =JavaScript的&GT;
功能GotoPage记述(的PageIndex){
$(#页)VAL(PageIndex的)。
$('#SearchForm)提交()。
} 功能的SortField(FLD,sortDirection){
$(#sort_field)VAL(FLD)。
$(#sort_dir)VAL(sortDirection)。
$('#SearchForm)提交()。
返回false;
}
&LT; / SCRIPT&GT;
&LT; H2&GT;文章管理和LT; / H&GT;
&LT;%字符串[] = articles_status {草稿,已提交,已发布,存档,删除}; %GT;
&LT;%VAR _gridState =(theSiteCMS.Controllers.ArticlesController.GridState)计算机[GridState];
VAR queryCollection = {新
sort_field = _gridState.sort.field
,sort_dir =(_gridState.sort.direction == theSiteCMS.Controllers.AppController.SortDirection.Descending)? 说明:ASC
状态= _gridState.status
,关键字= _gridState.keyword
用户名= _gridState.username
,SECTION_ID = _gridState.section_id
,CATEGORY_ID = _gridState.category_id
页= _gridState.page
};
%GT;
&LT;%Html.BeginForm(指数,公司章程,FormMethod.Post,新{ID =SearchForm}); %GT;
&LT;表格的宽度=100%&GT;
&所述; TR&GT;
&LT; TD WIDTH =16%&GT;状态和LT; / TD&GT;
&LT; TD WIDTH =16%&gt;部分&LT; / TD&GT;
&LT; TD WIDTH =16%&GT;分类和LT; / TD&GT;
&LT;! - TD WIDTH =16%&GT;&出版LT; / TD - &GT;
&LT; TD WIDTH =16%&gt;用户&LT; / TD&GT;
&LT; TD WIDTH =16%&GT;&关键字LT; / TD&GT;
&LT; TD WIDTH =4%&GT;&安培; NBSP;&LT; / TD&GT;
&LT; / TR&GT;
&所述; TR&GT;
&LT; TD&GT;&LT;%= Html.DropDownList(地位,theSiteCMS.Controllers.ArticlesController.ArticleStatusList(_gridState.status),ALL,新平变化{=this.form.submit();})% &GT;&LT; / TD&GT;
&LT; TD&GT;&LT;%= Html.DropDownList(SECTION_ID,theSiteCMS.Controllers.SectionsController.SectionsList(_gridState.section_id) - 选择all--,新平变化{=this.form.submit() ;})%GT;&LT; / TD&GT;
&LT; TD&GT;&LT;%= Html.DropDownList(CATEGORY_ID,theSiteCMS.Controllers.SectionsController.CategoriesList(_gridState.section_id,_gridState.category_id) - 选择all--,新平变化{=this.form .submit();})%GT;&LT; / TD&GT;
&所述;! - TD方式&gt;&下;%/ * Html.jQuery()的DatePicker()
。名称(publish_at)
.DateFormat(MM-DD-YY)
.NavigationAsDateFormat(真)
.HtmlAttributes(新{风格=WIDTH:100px的})
.Render(); * /%GT;&LT; / TD - &GT;
&LT; TD&GT;&LT;%= Html.TextBox(用户名,_gridState.username,新{风格=WIDTH:100px的})%GT;&LT; / TD&GT;
&LT; TD&GT;&LT;%= Html.TextBox(关键字,_gridState.keyword,新{风格=WIDTH:100px的})%GT;&LT; / TD&GT;
&LT; TD WIDTH =15%&GT;&LT;输入类型=提交值=发现/&GT;&LT; / TD&GT;
&LT; / TR&GT;
&LT; /表&gt;
&LT;%= Html.Hidden(sort_dir,_gridState.sort.direction == theSiteCMS.Controllers.AppController.SortDirection.Descending说明:ASC)%GT;
&所述;%= Html.Hidden(sort_field,_gridState.sort.field)%GT; &LT;%= Html.Hidden(页,_gridState.page)%GT;
&所述;%Html.EndForm(); %GT;
&LT;小时/&GT; &LT;表格的宽度=100%&GT;
&LT;标题&GT;&LT;%=计算机[消息]%GT;&LT; /字幕&GT;
&所述; TR&GT;
&LT;第i个动作&LT; /第i
百分位&GT;&LT;%= Html.ActionLink(标题,索引,新{行动=索引},{新@class = Html.GetSortCssClass(_gridState.sort,称号)的onclick =返回的SortField('标题','ASC');})%GT;&LT; /第i
百分位&GT;&LT;%= Html.ActionLink(作者,索引,新{行动=索引},{新@class = Html.GetSortCssClass(_gridState.sortUSER_ID)的onclick =的SortField('USER_ID','ASC');返回false;})%GT;&LT; /第i
百分位&GT;&LT;%= Html.ActionLink(日期,索引,新{行动=索引},{新@class = Html.GetSortCssClass(_gridState.sortpublish_at)的onclick =的SortField('publish_at','ASC');返回false;})%GT;&LT; /第i
百分位&GT;&LT;%= Html.ActionLink(状态,索引,新{行动=索引},{新@class = Html.GetSortCssClass(_gridState.sort,身份)的onclick =的SortField('状态','ASC');返回false;})%GT;&LT; /第i
&LT;第i个
注释
&LT; /第i
&LT;第i个
查看次数
&LT; /第i
&LT; / TR&GT; &LT;%的foreach(在型号VAR项)
{%GT; &所述; TR&GT;
&LT; TD WIDTH =100&GT;
&LT;%= Html.ActionLinkImage(编辑,Url.Content(〜/图片/图标/ pencil.png),编辑,新{行动=编辑,ID = item.id},{新标题=编辑})%GT;
&LT;%= Html.ActionLinkImage(查看,Url.Content(〜/图片/图标/ eye.png),详细信息,新{行动=详细信息,ID = item.id},{新标题=查看})%GT;&LT; BR /&GT;
&LT;%,如果(item.status == 0){//%草案&GT;
&LT;%= Html.Image(〜/图片/图标/ application_edit.png,新的{@类=已禁用})%GT;
&LT;%}其他{%GT;
&LT;%= Html.ActionLinkImage(征求意见稿,Url.Content(〜/图片/图标/ application_edit.png),changeStatus,新{行动=changeStatus,ID = item.id,S = 0 },{新标题=草案})%GT;
&LT;%}%GT; &LT;%,如果(item.status == 1){//提交%GT;
&LT;%= Html.Image(〜/图片/图标/ application_go.png,新的{@类=已禁用})%GT;
&LT;%}其他{%GT;
&LT;%= Html.ActionLinkImage(征求意见稿,Url.Content(〜/图片/图标/ application_go.png),changeStatus,新{行动=changeStatus,ID = item.id,S = 1 },{新标题=提交})%GT;
&LT;%}%GT;
&LT;%,如果(item.status == 2){//出版%GT;
&LT;%= Html.Image(〜/图片/图标/ accept.png,新的{@类=已禁用})%GT;
&LT;%}其他{%GT;
&LT;%= Html.ActionLinkImage(发布,Url.Content(〜/图片/图标/ accept.png),changeStatus,新{行动=changeStatus,ID = item.id,S = 2 },{新标题=发布})%GT;
&LT;%}%GT;
&LT;%,如果(item.status == 3){//存档%GT;
&LT;%= Html.Image(〜/图片/图标/ COM press.png,新的{@类=已禁用})%GT;
&LT;%}其他{%GT;
&LT;%= Html.ActionLinkImage(归档,Url.Content(〜/图片/图标/ COM press.png),changeStatus,新{行动=changeStatus,ID = item.id ,S = 3},{新标题=归档})%GT;
&LT;%}%GT;
&LT;%,如果(item.status == 4){//删除%GT;
&LT;%= Html.Image(〜/图片/图标/ application_delete.png,新的{@类=已禁用})%GT;
&LT;%}其他{%GT;
&LT;%= Html.ActionLinkImage(归档,Url.Content(〜/图片/图标/ application_delete.png),changeStatus,新{行动=changeStatus,ID = item.id,S = 4 },{新标题=删除})%GT;
&LT;%}%GT;
&LT; / TD&GT;
&所述; TD&GT;
&LT;%= Html.En code(item.title)%GT;&LT; BR /&GT;
&LT;%= Html.En code(item.Category.Section.title)%GT; ,&LT;%= Html.En code(item.Category.title)%GT;
&LT; / TD&GT;
&所述; TD&GT;
&LT;%= Html.En code(item.User.username)%GT;
&LT; / TD&GT; &所述; TD&GT;
&LT;%= Html.En code(的String.Format({0:绿},item.publish_at))%GT;
&LT; / TD&GT; &所述; TD&GT;
&LT;%= Html.En code(articles_status [item.status])%GT;
&LT; / TD&GT;
&所述; TD&GT;
&LT;%= Html.En code(item.Comments.Count())%GT;
&LT; / TD&GT;
&所述; TD&GT;
&LT;%= Html.En code(item.viewcount)%GT;
&LT; / TD&GT; &LT; / TR&GT; &LT;%}%GT; &LT; /表&gt; &LT; DIV CLASS =分页&GT;
&LT;%,如果(Model.Has previousPage)
{%GT;
&LT;%= Html.RouteLink(previous
默认,
新{页=(Model.PageIndex - 1)})%GT; &LT;%}
其他
{%GT;
previous
&LT;%}%GT;
|
&LT;如果%(Model.HasNextPage)
{%GT; &LT;%= Html.RouteLink(下一步,
默认,
新{页=(Model.PageIndex + 1)})%GT; &LT;%}
其他
{%GT;
下一个
&LT;%}%GT;
&LT; / DIV&GT;
&LT; / ASP:内容&GT;
的错误我得到:
的调用以下方法或属性之间暧昧:
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
和
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
\\我的文档\\ Visual Studio 2008的\\项目\\ 3ICMS \\查看\\ \\文章111的Index.aspx
------
电话是以下方法或属性之间暧昧:
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
\\我的文档\\ Visual Studio 2008的\\项目\\ 3ICMS \\查看\\ \\文章116的Index.aspx
------
电话是以下方法或属性之间暧昧:
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
和
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
\\我的文档\\ Visual Studio 2008的\\项目\\ 3ICMS \\查看\\ \\文章106的Index.aspx
------
电话是以下方法或属性之间暧昧:
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)和
System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串,对象,对象)
\\我的文档\\ Visual Studio 2008的\\项目\\ 3ICMS \\查看\\ \\文章101的Index.aspx
我的建议将是从删除System.Web.MVC任何引用theSiteCMS
(自'theSite.dll
已经包含了它),然后添加 theSiteDLL
为项目referece 的。
我assumming两者是相同的解决方案文件中。我希望这有助于。
I have 2 websites; One is for Public and other for admin.These boith are seperate websites.theSite.dll is for public and theSiteCMS for admin.
The code below is from AdminSite i.e theSiteCMS.This site also contains theSite.dll reference which also has same member functions Html.ActiveLinkImage.
I doubt that I am not able to isolate these call ;hence the error.Kindly suggest the right way.
Code theSiteCMS(admin site)
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<theSiteCMS.Helpers.Pagination<theSiteCMS.Models.Article>>"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Articles Management
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" language="javascript">
function goToPage(pageIndex) {
$("#page").val(pageIndex);
$('#SearchForm').submit();
}
function sortField(fld, sortDirection) {
$("#sort_field").val(fld);
$("#sort_dir").val(sortDirection);
$('#SearchForm').submit();
return false;
}
</script>
<h2>Articles Management</h2>
<% string[] articles_status = { "Draft", "Submitted", "Published", "Archived", "Deleted" }; %>
<% var _gridState = (theSiteCMS.Controllers.ArticlesController.GridState)ViewData["GridState"];
var queryCollection = new {
sort_field= _gridState.sort.field
,sort_dir = (_gridState.sort.direction == theSiteCMS.Controllers.AppController.SortDirection.Descending) ? "desc" : "asc"
,status = _gridState.status
,keyword = _gridState.keyword
,username = _gridState.username
,section_id = _gridState.section_id
,category_id = _gridState.category_id
,page = _gridState.page
};
%>
<%Html.BeginForm("index", "Articles", FormMethod.Post, new { id="SearchForm"}); %>
<table width="100%">
<tr>
<td width="16%">Status</td>
<td width="16%">Section</td>
<td width="16%">Category</td>
<!--td width="16%">Published</td-->
<td width="16%">User</td>
<td width="16%">Keyword</td>
<td width="4%"> </td>
</tr>
<tr>
<td><%= Html.DropDownList("status", theSiteCMS.Controllers.ArticlesController.ArticleStatusList(_gridState.status), "ALL", new { onchange = "this.form.submit();" })%></td>
<td><%= Html.DropDownList("section_id", theSiteCMS.Controllers.SectionsController.SectionsList(_gridState.section_id), "--select all--", new { onchange = "this.form.submit();" })%></td>
<td><%= Html.DropDownList("category_id", theSiteCMS.Controllers.SectionsController.CategoriesList(_gridState.section_id, _gridState.category_id), "--select all--", new { onchange = "this.form.submit();" })%></td>
<!--td><%/* Html.jQuery().DatePicker()
.Name("publish_at")
.DateFormat("mm-dd-yy")
.NavigationAsDateFormat(true)
.HtmlAttributes(new { style="width:100px"})
.Render();*/ %></td-->
<td><%= Html.TextBox("username", _gridState.username, new { style = "width:100px" })%></td>
<td><%= Html.TextBox("keyword", _gridState.keyword, new { style="width:100px"})%></td>
<td width="15%"><input type="submit" value="find" /></td>
</tr>
</table>
<%=Html.Hidden("sort_dir", _gridState.sort.direction == theSiteCMS.Controllers.AppController.SortDirection.Descending?"desc":"asc") %>
<%=Html.Hidden("sort_field", _gridState.sort.field) %>
<%=Html.Hidden("page", _gridState.page) %>
<%Html.EndForm(); %>
<hr />
<table width ="100%">
<caption><%= ViewData["Message"] %></caption>
<tr>
<th>Action</th>
<th><%= Html.ActionLink("Title", "Index", new { action="Index"}, new { @class = Html.GetSortCssClass(_gridState.sort, "title"), onclick = "return sortField('title','asc');" })%></th>
<th><%= Html.ActionLink("Author", "Index", new { action="Index"}, new { @class = Html.GetSortCssClass(_gridState.sort, "user_id"), onclick = "sortField('user_id','asc');return false;" })%></th>
<th><%= Html.ActionLink("Date", "Index", new { action="Index"}, new { @class = Html.GetSortCssClass(_gridState.sort, "publish_at"), onclick = "sortField('publish_at','asc');return false;" })%></th>
<th><%= Html.ActionLink("Status", "Index", new { action="Index"}, new { @class = Html.GetSortCssClass(_gridState.sort, "status"), onclick = "sortField('status','asc');return false;" })%></th>
<th>
Comments
</th>
<th>
View count
</th>
</tr>
<% foreach (var item in Model)
{ %>
<tr>
<td width="100">
<%=Html.ActionLinkImage("Edit", Url.Content("~/images/icons/pencil.png"), "Edit", new { action = "Edit", id = item.id }, new { title = "Edit" })%>
<%=Html.ActionLinkImage("View", Url.Content("~/images/icons/eye.png"), "Details", new { action = "Details", id = item.id }, new { title = "View" })%><br />
<% if (item.status ==0){ //draft%>
<%=Html.Image("~/images/icons/application_edit.png", new {@class="disabled"}) %>
<%} else {%>
<%=Html.ActionLinkImage("Draft", Url.Content("~/images/icons/application_edit.png"), "changeStatus", new { action = "changeStatus", id = item.id, s = 0 }, new { title="Draft"})%>
<%} %>
<% if (item.status ==1){ //submit%>
<%=Html.Image("~/images/icons/application_go.png", new {@class="disabled"}) %>
<%} else {%>
<%=Html.ActionLinkImage("Draft", Url.Content("~/images/icons/application_go.png"), "changeStatus", new { action = "changeStatus", id = item.id, s = 1 }, new { title = "Submit" })%>
<%} %>
<% if (item.status ==2){ //publish %>
<%=Html.Image("~/images/icons/accept.png", new {@class="disabled"}) %>
<%} else {%>
<%=Html.ActionLinkImage("Publish", Url.Content("~/images/icons/accept.png"), "changeStatus", new { action = "changeStatus", id = item.id, s = 2 }, new { title = "Publish" })%>
<%} %>
<% if (item.status ==3){ //archive %>
<%=Html.Image("~/images/icons/compress.png", new {@class="disabled"}) %>
<%} else {%>
<%=Html.ActionLinkImage("Archive", Url.Content("~/images/icons/compress.png"), "changeStatus", new { action = "changeStatus", id = item.id, s = 3 }, new { title = "Archive" })%>
<%} %>
<% if (item.status ==4){ //deleted %>
<%=Html.Image("~/images/icons/application_delete.png", new {@class="disabled"}) %>
<%} else {%>
<%=Html.ActionLinkImage("Archive", Url.Content("~/images/icons/application_delete.png"), "changeStatus", new { action = "changeStatus", id = item.id, s = 4 }, new { title = "Delete" })%>
<%} %>
</td>
<td>
<%= Html.Encode(item.title)%><br/>
<%= Html.Encode(item.Category.Section.title)%> , <%= Html.Encode(item.Category.title)%>
</td>
<td>
<%= Html.Encode(item.User.username)%>
</td>
<td>
<%= Html.Encode(String.Format("{0:g}", item.publish_at))%>
</td>
<td>
<%= Html.Encode(articles_status[item.status])%>
</td>
<td>
<%= Html.Encode(item.Comments.Count())%>
</td>
<td>
<%= Html.Encode(item.viewcount)%>
</td>
</tr>
<% } %>
</table>
<div class="pagination">
<% if (Model.HasPreviousPage)
{ %>
<%= Html.RouteLink("previous",
"Default",
new { page = (Model.PageIndex - 1) })%>
<% }
else
{ %>
previous
<%} %>
|
<% if (Model.HasNextPage)
{ %>
<%= Html.RouteLink("next",
"Default",
new { page = (Model.PageIndex + 1) })%>
<% }
else
{ %>
next
<%} %>
</div>
</asp:Content>
The Error I get:
The call is ambiguous between the following methods or properties:
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
and
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
\My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 111
------
The call is ambiguous between the following methods or properties:
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
\My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 116
------
The call is ambiguous between the following methods or properties:
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
and
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
\My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 106
------
The call is ambiguous between the following methods or properties:
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' and
'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)'
\My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 101
My suggestion will be to remove any reference of System.Web.MVC from 'theSiteCMS'
(since 'theSite.dll'
already contains it) and then add theSiteDLL
as project referece.
I am assumming both of them are inside the same solution file. I hope this helps.
这篇关于电话是以下方法或属性之间暧昧:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!