首页 新闻 搜索 专区 学院

(LINQ+MVC)无法枚举查询结果多次!

0
悬赏园豆:50 [已关闭问题]
RT:<br><b><br>我在使用扩展方法的时候``` 他报了个这个错误`由于水平有限……So<br><br>请各位大大 帮帮 忙呀` 我把 代码 贴上来 请大家看下的哈!!!</b><br><br>这个是扩展方法<br><div class="cnblogs_code"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><img src="/Images/OutliningIndicators/None.gif" align="top"><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;IndexHtmler<br><img src="/Images/OutliningIndicators/ExpandedBlockStart.gif" id="Codehighlighter1_36_1399_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_36_1399_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_36_1399_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_36_1399_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedBlock.gif" id="Codehighlighter1_36_1399_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_36_1399_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_36_1399_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_36_1399_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_36_1399_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_36_1399_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;LinkList(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">&nbsp;HtmlHelper&nbsp;helper,&nbsp;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;obj,TakeRec&nbsp;tr)<br><img src="/Images/OutliningIndicators/ExpandedSubBlockStart.gif" id="Codehighlighter1_131_182_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_131_182_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_131_182_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_131_182_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedSubBlock.gif" id="Codehighlighter1_131_182_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_131_182_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_131_182_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_131_182_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_131_182_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_131_182_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;getDataList(obj,tr);<br><img src="/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;getDataList(</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;obj,TakeRec&nbsp;getRec)<br><img src="/Images/OutliningIndicators/ExpandedSubBlockStart.gif" id="Codehighlighter1_260_1305_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_260_1305_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_260_1305_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_260_1305_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedSubBlock.gif" id="Codehighlighter1_260_1305_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_260_1305_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_260_1305_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_260_1305_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_260_1305_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_260_1305_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(obj&nbsp;</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Exception(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">对象不能为空</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(obj&nbsp;</span><span style="color: rgb(0, 0, 255);">is</span><span style="color: rgb(0, 0, 0);">&nbsp;IEnumerable</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">mvc_GetAllMvc_LinksResult</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">)<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">throw</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Exception(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">对象不能序列化</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuilder&nbsp;sb&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuilder();<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ISingleResult</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">mvc_GetAllMvc_LinksResult</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;objList&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;((ISingleResult</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">mvc_GetAllMvc_LinksResult</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">)obj);<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IOrderedEnumerable</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">mvc_GetAllMvc_LinksResult</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;resList&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(getRec&nbsp;</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">&nbsp;TakeRec.Top)<br><img src="/Images/OutliningIndicators/ExpandedSubBlockStart.gif" id="Codehighlighter1_747_888_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_747_888_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_747_888_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_747_888_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedSubBlock.gif" id="Codehighlighter1_747_888_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_747_888_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_747_888_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_747_888_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_747_888_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_747_888_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resList&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(IOrderedEnumerable</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">mvc_GetAllMvc_LinksResult</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">)objList.Take(</span><span style="color: rgb(128, 0, 128);">4</span><span style="color: rgb(0, 0, 0);">).OrderByDescending(o&nbsp;</span><span style="color: rgb(0, 0, 0);">=&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;o.LinkOrder);<br><img src="/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/ExpandedSubBlockStart.gif" id="Codehighlighter1_918_1049_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_918_1049_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_918_1049_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_918_1049_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedSubBlock.gif" id="Codehighlighter1_918_1049_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_918_1049_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_918_1049_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_918_1049_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_918_1049_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_918_1049_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resList&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(IOrderedEnumerable</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">mvc_GetAllMvc_LinksResult</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">)objList.Take(</span><span style="color: rgb(128, 0, 128);">4</span><span style="color: rgb(0, 0, 0);">).OrderBy(o&nbsp;</span><span style="color: rgb(0, 0, 0);">=&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;o.LinkOrder);<br><img src="/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">foreach</span><span style="color: rgb(0, 0, 0);">&nbsp;(var&nbsp;i&nbsp;</span><span style="color: rgb(0, 0, 255);">in</span><span style="color: rgb(0, 0, 0);">&nbsp;resList)<br><img src="/Images/OutliningIndicators/ExpandedSubBlockStart.gif" id="Codehighlighter1_1101_1233_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_1101_1233_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_1101_1233_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_1101_1233_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedSubBlock.gif" id="Codehighlighter1_1101_1233_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_1101_1233_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_1101_1233_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_1101_1233_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1101_1233_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_1101_1233_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.AppendFormat(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">&lt;li&gt;&lt;div&gt;&lt;a&nbsp;href='{0}'&nbsp;target='_blank'&gt;{1}&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;i.LinkUrl,&nbsp;i.LinkName);<br><img src="/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objList&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;sb.ToString();<br><img src="/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">enum</span><span style="color: rgb(0, 0, 0);">&nbsp;TakeRec<br><img src="/Images/OutliningIndicators/ExpandedSubBlockStart.gif" id="Codehighlighter1_1349_1393_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_1349_1393_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_1349_1393_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_1349_1393_Closed_Text').style.display='inline';" align="top"><img src="/Images/OutliningIndicators/ContractedSubBlock.gif" id="Codehighlighter1_1349_1393_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_1349_1393_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_1349_1393_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_1349_1393_Open_Text').style.display='inline';" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1349_1393_Closed_Text" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255); display: none;"><img src="/images/dot.gif"></span><span id="Codehighlighter1_1349_1393_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Top,<br><img src="/Images/OutliningIndicators/InBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bot<br><img src="/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}<br><br><b>下面是调用的(我跟踪了下 好象是第2次调用 就报那个错了)<br>请大大们帮忙解决下 谢谢!!!</b><br>&lt;ul&gt; <br>&nbsp; &lt;% =Html.LinkList(ViewData.Model,IndexHtmler.TakeRec.Top)%&gt;<br>&lt;/ul&gt;<br>&lt;ul&gt;<br>&nbsp; &lt;% =Html.LinkList(ViewData.Model,IndexHtmler.TakeRec.Bot)%&gt;<br>&lt;/ul&gt;<br><br><br><b>这个是控制器的东西:</b><br>&nbsp;public class IndexController : Controller<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public ActionResult Index()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mvc_LinksDataContext obj = new Mvc_LinksDataContext();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ISingleResult&lt;mvc_GetAllMvc_LinksResult&gt; list = (ISingleResult&lt;mvc_GetAllMvc_LinksResult&gt;)obj.mvc_GetAllMvc_Links();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ViewData["Title"] = "My LinqDemo Of Mvc";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return View("../Index", list);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br><b>LINQ TO SQL 采用了 存储过程的。。。</b></span></span><span id="Codehighlighter1_36_1399_Open_Text"><span style="color: rgb(0, 0, 0);"><b>mvc_GetAllMvc_LinksResult 这个就是。。。<br><br>帮帮忙 谢谢!</b><br></span></span><span id="Codehighlighter1_36_1399_Open_Text"><span style="color: rgb(0, 0, 0);"><br></span></span></div><br>
问题补充: 提示的错误 就是 我在调用 我的扩展方法的 时候` 他就 出这个 错了 !!! --------------------------------------------------- [无法枚举查询结果多次]
阳光囧男的主页 阳光囧男 | 菜鸟二级 | 园豆:215
提问于:2008-08-10 15:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册