<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'suggestion'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=suggestion&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'suggestion'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Lurking on a thread would be useful ...</title><link>http://forums.asp.net/thread/2906108.aspx</link><pubDate>Sat, 31 Jan 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2906108</guid><dc:creator>gerrylowry</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;if I start a thread or if I reply to a thread, I get &lt;strong&gt;e-mail notifications&lt;/strong&gt; every time there&amp;#39;s&lt;br /&gt;any further activity on that thread, either by myself or by someone else.&amp;nbsp; &lt;strong&gt;This is good!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are &lt;strong&gt;some specific threads&lt;/strong&gt; that I find interesting and&amp;nbsp;possibly very useful&lt;br /&gt;that I would like to follow closely &lt;strong&gt;via e-mail notifications&lt;/strong&gt;.&amp;nbsp; How can I do this&lt;br /&gt;&lt;strong&gt;without&lt;/strong&gt; actually replying to those threads?&amp;nbsp; For me, this would be &lt;strong&gt;very&lt;/strong&gt; useful.&lt;br /&gt;&lt;br /&gt;Please advise.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Gerry (Lowry)&lt;/p&gt;</description></item><item><title>Should Html helpers be recategorized?</title><link>http://forums.asp.net/thread/2597100.aspx</link><pubDate>Wed, 03 Sep 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2597100</guid><dc:creator>dougcook</dc:creator><description>&lt;p&gt;The Html helper stuff (can&amp;#39;t call it a class since it is mostly extension methods...&amp;nbsp;&lt;img src="http://forums.asp.net/emoticons/emotion-4.gif" alt="Stick out tongue" /&gt;) seems to have two modes. In the first mode, you use it like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;%= Html.ReturnSomething(stuff) %&amp;gt;&lt;/p&gt;&lt;p&gt;In the other mode, you use it like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;% Html.WriteSomething(stuff) %&amp;gt;&lt;/p&gt;&lt;p&gt;or like this:&lt;/p&gt;&lt;p&gt;&amp;lt;% using (Html.StartSomething(stuff)) %&amp;gt;morestuff&amp;lt;% } %&amp;gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;This has been a source of confusion to myself, and it appears to be confusing to others as well.&lt;/p&gt;&lt;p&gt;My gut feeling is that the two types of usage should be in two different categories using two different &amp;quot;keywords&amp;quot;. I&amp;#39;m not great with keywords, but maybe the methods that return a string should be invoked via &amp;quot;Tag&amp;quot;, i.e. Tag.SubmitButton(). Or perhaps the methods that directly write something should change to use a different keyword like &amp;quot;Render&amp;quot;, i.e. Render.Form(...).&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Wiki Feedback</title><link>http://forums.asp.net/thread/2450912.aspx</link><pubDate>Thu, 26 Jun 2008 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2450912</guid><dc:creator>Tigraine</dc:creator><description>&lt;p&gt;&amp;nbsp;I&amp;#39;ve &lt;a href="http://www.tigraine.at/2008/06/23/aspnet-wiki-an-unpleasant-experience/"&gt;blogged about it &lt;/a&gt;and just wanted to repeat my complaints about it here:&lt;/p&gt;&lt;p&gt;I think it&amp;#39;s a shame there is no real way to post source code to the Wiki without syntax-highlighting it offline.&lt;br /&gt;After all the Wiki is about programming, and programming is about source, so weeding through HTML if you want to edit anything sucks big time.&lt;br /&gt;I also do think that it really keeps people from contributing because doing the syntax highlighting offline isn&amp;#39;t something anybody wants to spend time on. &lt;br /&gt;As long as there is no copy+paste solution I don&amp;#39;t see too much success for the wiki right now (besides all the people who just copy/paste their old tutorials/posts to the wiki)&lt;/p&gt;&lt;p&gt;&amp;nbsp;greetings Tigraine &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Web User Controls + Controllers?</title><link>http://forums.asp.net/thread/2120438.aspx</link><pubDate>Sun, 20 Jan 2008 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2120438</guid><dc:creator>tgmdbm</dc:creator><description>
&lt;p&gt;Yeah. you can put a Controller class anywhere, even the root if you like, but i like \Controllers\Controls for a controller which renders a control as opposed to a page.&lt;/p&gt;

&lt;p&gt;Then when you want to render your control, you don&amp;#39;t use Html.RenderUserControl, what you do is call a method on a controller. I&amp;#39;ve written a helper method to do this but it&amp;#39;s a bit of a hack. I&amp;#39;ll show you my first attempt and then what that turned into.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The following will be called like - &amp;lt;% Html.Call&amp;lt;MyController&amp;gt;( c =&amp;gt; c.Index() ); %&amp;gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;    &lt;span class="kwd"&gt;public static void&lt;/span&gt; Call&amp;lt;TController&amp;gt;(&lt;span class="kwd"&gt;this&lt;/span&gt; HtmlHelper helper, Action&amp;lt;TController&amp;gt; method) where TController : &lt;span class="kwd"&gt;class&lt;/span&gt;, IController&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;    {&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;      IHttpContext context = helper.ViewContext.HttpContext;&lt;br /&gt;&lt;b id="4"&gt;4    &lt;/b&gt;      RouteData routeData = helper.ViewContext.RouteData;&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;      RequestContext requestContext = &lt;span class="kwd"&gt;new&lt;/span&gt; RequestContext( context, routeData );&lt;br /&gt;&lt;b id="6"&gt;6    &lt;/b&gt;
&lt;b id="7"&gt;7    &lt;/b&gt;      TController controller = ControllerBuilder.Current.CreateController( requestContext, &lt;span class="kwd"&gt;typeof&lt;/span&gt;( TController ) ) &lt;span class="kwd"&gt;as&lt;/span&gt; TController;&lt;br /&gt;&lt;b id="8"&gt;8    &lt;/b&gt;
&lt;b id="9"&gt;9    &lt;/b&gt;      &lt;span class="kwd"&gt;if&lt;/span&gt;( controller == &lt;span class="kwd"&gt;null&lt;/span&gt; )&lt;br /&gt;&lt;b id="10"&gt;10   &lt;/b&gt;        &lt;span class="kwd"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;b id="11"&gt;11   &lt;/b&gt;
&lt;b id="12"&gt;12   &lt;/b&gt;      method( controller );&lt;br /&gt;&lt;b id="13"&gt;13   &lt;/b&gt;    }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Fairly simple and easy to read. new up a request context, passing in the current values. Build a controller and call the action. But obviously this doesn&amp;#39;t work. It looks in the wrong folder for the view. the controller context is null. and TempData is null.&lt;/p&gt;

&lt;p&gt;So, we need to:&lt;br /&gt;copy the route data without modifying the original.&lt;br /&gt;set the new controller name in the route data.&lt;br /&gt;new up a controller context and pass that to the controller (This step prevents us from being able to act on an IController, and only works for instances of Controller, which is a shame).&lt;br /&gt;And pass TempData to the controller, even tho the setter is not public... &lt;/p&gt;

&lt;p&gt;Here&amp;#39;s the code.&amp;nbsp;&lt;/p&gt;

&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;    &lt;span class="kwd"&gt;public static void&lt;/span&gt; Call&amp;lt;TController&amp;gt;(&lt;span class="kwd"&gt;this&lt;/span&gt; HtmlHelper helper, Action&amp;lt;TController&amp;gt; method) where TController : Controller&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;    {&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;      IHttpContext context = helper.ViewContext.HttpContext;&lt;br /&gt;&lt;b id="4"&gt;4    &lt;/b&gt;      RouteData routeData = &lt;span class="kwd"&gt;new&lt;/span&gt; RouteData();&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;&lt;br /&gt;&lt;b id="6"&gt;6    &lt;/b&gt;      &lt;span class="cmt"&gt;// Copy RouteData&lt;/span&gt;&lt;br /&gt;&lt;b id="7"&gt;7    &lt;/b&gt;      &lt;span class="kwd"&gt;foreach&lt;/span&gt;( &lt;span class="kwd"&gt;string&lt;/span&gt; key &lt;span class="kwd"&gt;in&lt;/span&gt; helper.ViewContext.RouteData.Values.Keys )&lt;br /&gt;&lt;b id="8"&gt;8    &lt;/b&gt;      {&lt;br /&gt;&lt;b id="9"&gt;9    &lt;/b&gt;        routeData.Values[key] = helper.ViewContext.RouteData.Values[key];&lt;br /&gt;&lt;b id="10"&gt;10   &lt;/b&gt;      }&lt;br /&gt;&lt;b id="11"&gt;11   &lt;/b&gt;&lt;br /&gt;&lt;b id="12"&gt;12   &lt;/b&gt;      &lt;span class="cmt"&gt;// Replace controller name&lt;/span&gt;&lt;br /&gt;&lt;b id="13"&gt;13   &lt;/b&gt;      &lt;span class="kwd"&gt;string&lt;/span&gt; controllerName = &lt;span class="kwd"&gt;typeof&lt;/span&gt;( TController ).Name;&lt;br /&gt;&lt;b id="14"&gt;14   &lt;/b&gt;&lt;br /&gt;&lt;b id="15"&gt;15   &lt;/b&gt;      &lt;span class="kwd"&gt;if&lt;/span&gt;( controllerName.EndsWith( &lt;span class="st"&gt;&amp;quot;Controller&amp;quot;&lt;/span&gt;, StringComparison.OrdinalIgnoreCase ) )&lt;br /&gt;&lt;b id="16"&gt;16   &lt;/b&gt;        controllerName = controllerName.Remove( controllerName.Length - 10 );&lt;br /&gt;&lt;b id="17"&gt;17   &lt;/b&gt;&lt;br /&gt;&lt;b id="18"&gt;18   &lt;/b&gt;      routeData.Values[&lt;span class="st"&gt;&amp;quot;controller&amp;quot;&lt;/span&gt;] = controllerName;&lt;br /&gt;&lt;b id="19"&gt;19   &lt;/b&gt;&lt;br /&gt;&lt;b id="20"&gt;20   &lt;/b&gt;      &lt;span class="cmt"&gt;// Create the controller&lt;/span&gt;&lt;br /&gt;&lt;b id="21"&gt;21   &lt;/b&gt;      RequestContext requestContext = &lt;span class="kwd"&gt;new&lt;/span&gt; RequestContext( context, routeData );&lt;br /&gt;&lt;b id="22"&gt;22   &lt;/b&gt;      TController controller = ControllerBuilder.Current.CreateController( requestContext, &lt;span class="kwd"&gt;typeof&lt;/span&gt;( TController ) ) &lt;span class="kwd"&gt;as&lt;/span&gt; TController;&lt;br /&gt;&lt;b id="23"&gt;23   &lt;/b&gt;&lt;br /&gt;&lt;b id="24"&gt;24   &lt;/b&gt;      &lt;span class="kwd"&gt;if&lt;/span&gt;( controller == &lt;span class="kwd"&gt;null&lt;/span&gt; )&lt;br /&gt;&lt;b id="25"&gt;25   &lt;/b&gt;        &lt;span class="kwd"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;b id="26"&gt;26   &lt;/b&gt;&lt;br /&gt;&lt;b id="27"&gt;27&lt;/b&gt;        &lt;span class="cmt"&gt;// Set ControllerContext event tho CreateController had enough information to do so.&lt;/span&gt;&lt;br /&gt;&lt;b id="27"&gt;28   &lt;/b&gt;      controller.ControllerContext = &lt;span class="kwd"&gt;new&lt;/span&gt; ControllerContext( requestContext, controller );&lt;br /&gt;&lt;b id="28"&gt;29   &lt;/b&gt;
&lt;b id="29"&gt;30   &lt;/b&gt;      &lt;span class="cmt"&gt;// HACK HACK HACK&lt;/span&gt;
&lt;b id="30"&gt;31   &lt;/b&gt;      PropertyInfo tdProp = &lt;span class="kwd"&gt;typeof&lt;/span&gt;( TController ).GetProperty( &lt;span class="st"&gt;&amp;quot;TempData&amp;quot;&lt;/span&gt; );&lt;br /&gt;&lt;b id="31"&gt;32   &lt;/b&gt;      tdProp.SetValue( controller, helper.ViewContext.TempData, &lt;span class="kwd"&gt;null&lt;/span&gt; );&lt;br /&gt;&lt;b id="32"&gt;33   &lt;/b&gt;
&lt;b id="33"&gt;34   &lt;/b&gt;      &lt;span class="cmt"&gt;// Call method.&lt;/span&gt;
&lt;b id="34"&gt;35   &lt;/b&gt;      method( controller );&lt;br /&gt;&lt;b id="35"&gt;36   &lt;/b&gt;    }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Another way to do this would be to change Action&amp;lt;TController&amp;gt; to Expression&amp;lt;Action&amp;lt;TController&amp;gt;&amp;gt; and build up the route data from that and then call Execute on the controller. But i think my first attempt is Ideal. It would be great if this was possible in a future release.&lt;br /&gt;&lt;/p&gt;
</description></item><item><title>Re: MVC Architecture</title><link>http://forums.asp.net/thread/2113484.aspx</link><pubDate>Wed, 16 Jan 2008 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2113484</guid><dc:creator>jrnail23</dc:creator><description>&lt;p&gt;That&amp;#39;s an excellent point, and obviously one I overlooked.&amp;nbsp; I guess then what we&amp;#39;d want is something that specifies an interface (or contract of some sort) for the post data expected by a controller action.&amp;nbsp; Instead of having to apply that interface/contract to the entire view, then maybe we&amp;#39;re talking about a way to apply it at the HTML form level (what&amp;#39;s actually being posted) or at the PartialView level.&lt;/p&gt;
&lt;p&gt;Any way a strongly typed contract could be applied between view posts &amp;amp; the receiving controller action would go a long way toward soothing my team&amp;#39;s anxieties toward ASP.NET MVC.&amp;nbsp; If something like this were to find its way into the MVC framework, I&amp;#39;d expect it to be optional, perhaps using optional attributes, or even a config value.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;I know a lot of people would rather do it the &amp;quot;Rails way&amp;quot; and keep things simple &amp;amp; quick, but we put a lot of stock into contracts/interfaces &amp;amp; strong typing as a means to aid refactoring &amp;amp; manage change (as well as to provide a bit of design-time quality control).&amp;nbsp; I wouldn&amp;#39;t want to force the rest of the MVC world to work this way, but we consider this to be an important part of the way we want to build our applications.&lt;/p&gt;
&lt;p&gt;If this sort of thing doesn&amp;#39;t make its way into the MVC framework, does anyone have any ideas as to how&amp;nbsp;we might&amp;nbsp;implement it&amp;nbsp;ourselves (or maybe in MvcContrib)?&lt;/p&gt;</description></item><item><title>Re: RedirectToAction with Lamba Expressions</title><link>http://forums.asp.net/thread/2073149.aspx</link><pubDate>Fri, 21 Dec 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2073149</guid><dc:creator>abombss</dc:creator><description>&lt;p&gt;&amp;nbsp;You might have seen me using fake code.&amp;nbsp; &lt;img src="http://forums.asp.net/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;&lt;p&gt;Lambdas for everything! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Controlling whitespace when using server-side evaluation</title><link>http://forums.asp.net/thread/2069042.aspx</link><pubDate>Wed, 19 Dec 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2069042</guid><dc:creator>abombss</dc:creator><description>&lt;p&gt;&amp;nbsp;Nice call, Brail for Monorail has the ability to have &amp;lt;%... -%&amp;gt;&amp;nbsp; The - before the closing script tag tells Brail to squash the new line.&amp;nbsp; It makes for some very nice html.&lt;/p&gt;&lt;p&gt;I&lt;a href="http://forums.asp.net/p/1194407/2068967.aspx#2068967"&gt;f we are talking about extending the asp.net compiler for MVC&lt;/a&gt;, I would throw this into the mix.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: MVCToolkit and nulls</title><link>http://forums.asp.net/thread/2068728.aspx</link><pubDate>Wed, 19 Dec 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2068728</guid><dc:creator>abombss</dc:creator><description>&lt;p&gt;&amp;nbsp;+1, NRE&amp;#39;s in views are a pain.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>MVCToolkit and nulls</title><link>http://forums.asp.net/thread/2068220.aspx</link><pubDate>Wed, 19 Dec 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2068220</guid><dc:creator>tgmdbm</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;&lt;p&gt;I&amp;#39;d like the MVCToolkit to be tolerant of nulls. I&amp;#39;ve been using ?? &amp;quot;&amp;quot; to avoid the null errors.&lt;/p&gt;&lt;p&gt;&amp;lt;%= Html.TextBox( &amp;quot;Name&amp;quot;, ViewData.Name ?? &amp;quot;&amp;quot; ) %&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As an aside, I&amp;#39;m really excited about extension methods, cos you can call them on null objects!!!!!!&lt;/p&gt;&lt;p&gt;public static string MyToString(this object obj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return obj == null ? String.Empty : obj.ToString();&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;// then you can do this;&lt;/p&gt;&lt;p&gt;object a = null;&lt;/p&gt;&lt;p&gt;a.MyToString(); // This looks like you&amp;#39;ll get a &lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;NullReferenceException&lt;/font&gt;&lt;/p&gt;&lt;p&gt;But you don&amp;#39;t! No errors, It returns the empty string if a is null. Something like this should be baked into the framework if you ask me.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modification to HttpContext Wrapper</title><link>http://forums.asp.net/thread/2066220.aspx</link><pubDate>Tue, 18 Dec 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2066220</guid><dc:creator>abombss</dc:creator><description>&lt;p&gt;&amp;nbsp;+1 This is one of the best suggestions I have heard.&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>