<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Avivo Tech Blog &#187; ASP.NET MVC</title>
	<atom:link href="http://tech.avivo.si/tag/aspnet-mvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.avivo.si</link>
	<description>Solving problems</description>
	<lastBuildDate>Tue, 24 Jan 2012 14:46:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>So, you can not delete Cookie? Huh, something about headers or headache&#8230;</title>
		<link>http://tech.avivo.si/2011/07/so-you-can-not-delete-cookie-huh-something-about-headers-or-headache/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=so-you-can-not-delete-cookie-huh-something-about-headers-or-headache</link>
		<comments>http://tech.avivo.si/2011/07/so-you-can-not-delete-cookie-huh-something-about-headers-or-headache/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 12:18:55 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA["Server cannot modify cookies after HTTP headers have been sent"]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[can not delete cookie]]></category>
		<category><![CDATA[charp]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[delete cookie]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[response]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1337</guid>
		<description><![CDATA[We wanted to delete cookie setting its expired date property to something in the past like this: HttpCookie cookie = new HttpCookie(this.Name); cookie.Expires = DateTime.UtcNow.AddMonths(-1); HttpContext.Current.Response.Cookies.Add(cookie); But we got an error: Server cannot modify cookies after HTTP headers have been sent. After searching and searching if we have somewhere Response.Write in or ASP.NET MVC code [...]]]></description>
			<content:encoded><![CDATA[<p>We wanted to delete cookie setting its expired date property to something in the past like this:</p>
<pre class="csharp">
HttpCookie cookie = new HttpCookie(this.Name);
cookie.Expires = DateTime.UtcNow.AddMonths(-1);
HttpContext.Current.Response.Cookies.Add(cookie);
</pre>
<div style="margin-top:30px;">But we got an error: </div>
<p><b>Server cannot modify cookies after HTTP headers have been sent.</b></p>
<p>After searching and searching if we have somewhere <b>Response.Write</b> in or ASP.NET MVC code we found out that we don&#8217;t have such things.<br />
Suddenly, we found out that we played with <b>Session</b> object (trying to clear it) before deleting <b>Cookie</b> and that was it. Reordering these operations solved our problem.</p>
<div style="margin-top:30px;"><b>Conclusion</b><br/>Session object also use cookies, we forgot.</div>
<h2 style="margin-top:30px; color:red;">Update on this case</h2>
<div style="margin-top:20px; color:red;">
This &#8220;solution&#8221; didn&#8217;t helped&#8230; Everything is so simple and was done with <a href="http://www.electrictoolbox.com/jquery-cookies/" target="_blank">JQuery cookie plugin</a>. One line of code from Javascript!</div>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/07/so-you-can-not-delete-cookie-huh-something-about-headers-or-headache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create random web hex color in C# / ASP.NET MVC</title>
		<link>http://tech.avivo.si/2011/04/create-random-web-hex-color-in-c-asp-net-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=create-random-web-hex-color-in-c-asp-net-mvc</link>
		<comments>http://tech.avivo.si/2011/04/create-random-web-hex-color-in-c-asp-net-mvc/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 22:46:16 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Programming Techniques]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[hash color]]></category>
		<category><![CDATA[random color]]></category>
		<category><![CDATA[web color]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1305</guid>
		<description><![CDATA[Random random = new Random(); int red = random.Next(0, 255); int green = random.Next(0, 255); int blue = random.Next(0, 255); string hexColour = String.Format("#{0:X2}{1:X2}{2:X2}", red, green, blue);]]></description>
			<content:encoded><![CDATA[<pre class=csharp>
Random random = new Random();
int red = random.Next(0, 255);
int green = random.Next(0, 255);
int blue = random.Next(0, 255);
string hexColour = String.Format("#{0:X2}{1:X2}{2:X2}", red, green, blue);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/04/create-random-web-hex-color-in-c-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to copy validation message from one element to another in ASP.NET MVC 2?</title>
		<link>http://tech.avivo.si/2011/04/how-to-copy-validation-message-from-one-element-to-another-in-asp-net-mvc-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-copy-validation-message-from-one-element-to-another-in-asp-net-mvc-2</link>
		<comments>http://tech.avivo.si/2011/04/how-to-copy-validation-message-from-one-element-to-another-in-asp-net-mvc-2/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 14:47:58 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Programming Techniques]]></category>
		<category><![CDATA[copy validation message]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[mvc 2]]></category>
		<category><![CDATA[validation in mvc 2]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1271</guid>
		<description><![CDATA[Just create an extension to ModelStateDictionary like this: using System; using System.Collections.Generic; using System.Data; using System.Text; using System.Web.Mvc; namespace Avivo.Web.Common { public static class ModelStateDictionaryExtensions { /// &#60;summary&#62; /// Copy validation message from one field to another /// &#60;/summary&#62; /// &#60;param name="modelState"&#62;model state&#60;/param&#62; /// &#60;param name="source"&#62;field to copy from&#60;/param&#62; /// &#60;param name="target"&#62;field to copy to&#60;/param&#62; [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-bottom:30px;">Just create an extension to <strong>ModelStateDictionary </strong>like this:</div>
<pre class="csharp">
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web.Mvc;

namespace Avivo.Web.Common
{
  public static class ModelStateDictionaryExtensions
  {
    /// &lt;summary&gt;
    /// Copy validation message from one field to another
    /// &lt;/summary&gt;
    /// &lt;param name="modelState"&gt;model state&lt;/param&gt;
    /// &lt;param name="source"&gt;field to copy from&lt;/param&gt;
    /// &lt;param name="target"&gt;field to copy to&lt;/param&gt;
    public static void CopyMessage(this ModelStateDictionary modelState, string source,
      string target)
    {
      if (modelState.ContainsKey(source) &#038;&#038; modelState.Errors.Count &gt; 0)
      {
        modelState.AddModelError(target, modelState.Errors[0].ErrorMessage);
      }
    }
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/04/how-to-copy-validation-message-from-one-element-to-another-in-asp-net-mvc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to show compiler errors in ASP.NET MVC Views?</title>
		<link>http://tech.avivo.si/2011/02/how-to-show-compiler-errors-in-asp-net-mvc-views/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-show-compiler-errors-in-asp-net-mvc-views</link>
		<comments>http://tech.avivo.si/2011/02/how-to-show-compiler-errors-in-asp-net-mvc-views/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 15:21:13 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[ascx]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[aspx]]></category>
		<category><![CDATA[compiler errors in asp.net mvc views]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[show error in aspx or ascx]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1195</guid>
		<description><![CDATA[Just open your csproj project file in notepad and find MvcBuildViews and set value to True. &#60;MvcBuildViews&#62;true&#60;/MvcBuildViews&#62;]]></description>
			<content:encoded><![CDATA[<p>Just open your <strong>csproj </strong>project file in notepad and find <strong>MvcBuildViews </strong>and set value to <strong>True</strong>.</p>
<pre class=xml>
&lt;MvcBuildViews&gt;true&lt;/MvcBuildViews&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/02/how-to-show-compiler-errors-in-asp-net-mvc-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create custom error 404 in ASP.NET MVC</title>
		<link>http://tech.avivo.si/2011/01/how-to-show-or-create-custom-404-error-page-in-asp-net-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-show-or-create-custom-404-error-page-in-asp-net-mvc</link>
		<comments>http://tech.avivo.si/2011/01/how-to-show-or-create-custom-404-error-page-in-asp-net-mvc/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 00:39:04 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[404 custom error page]]></category>
		<category><![CDATA[404 error]]></category>
		<category><![CDATA[custom 404 error page]]></category>
		<category><![CDATA[error page]]></category>
		<category><![CDATA[how to create custom 404 error page]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=1158</guid>
		<description><![CDATA[Introduction So, whenever an error occurs, you would like to show a custom 404 error page in ASP.NET MVC? This blog post describes how to techically handle and display error page effectively. Reader should have some basic knowledge of setting IIS and ASP .NET MVC project. Error page is displayed when something goes wrong. Page [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>So, whenever an error occurs, you would like to show a custom 404 error page in ASP.NET MVC? This blog post describes how to techically handle and display error page effectively. Reader should have some basic knowledge of setting IIS and ASP .NET MVC project.</p>
<p>Error page is displayed when something goes wrong. Page should inform user about what happened and what he or she should do next. Page should also inform bots, crawlers, spiders not to search any relevent content in there, e.g. Google won&#8217;t display error page as search result. This is handled with HTTP status code known as 404. There are also <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">other HTTP status codes</a> for specific problems, e.g. for maintenance, for restricted access&#8230;</p>
<h2>Create action and view</h2>
<p>First, create a friendly page for user and set indicator for bots not to handle this page as obvious page. In this case &#8220;Main&#8221; controller with &#8220;Error&#8221; action. Note for IE 5,6: error page should have content larger than 512 bytes otherwise IE will display its own content.</p>
<pre class=csharp>
public class MainController
{
  public ActionResult Error()
  {
    //404 - Tell search engine not to display this page on search results
    Response.StatusCode = 404;
    Response.StatusDescription = "Not Found";
    return View();
  }
}
</pre>
<h2>Register route that eats anything</h2>
<p>Open Global.asax(.cs) in the MVC project and register error page route. Rule should be designed to capture all requests that do not fit in previous route rules. Simple solution: <tt>{*anything}</tt> rule captures any path including slashes, e.g. <em>/shop/mushrooms-123</em>.</p>
<pre class=csharp>
//Somewhere in Global.asax
public static void RegisterRoutes(RouteCollection routes)
{
  //Registered routes
  //...

  //Error route should be registered last
  routes.MapRoute
  (
    "ErrorPage",
    "{*anything}",
    new { controller = "Main", action = "Error" }
  );
}
</pre>
<p>
<strong>Advantage</strong>: no redirects, requested URL string should be kept in browser&#8217;s location bar. For example, when<br />
user requests <em>/shop/mushrooms-123</em> in browser the error page content will be display but the URL will remain original.<br />
The opposite of redirecting and displaying <em>/error</em> in location bar.</p>
<h2>How to handle other errors?</h2>
<p>Other errors in ASP .NET can be handled in <tt>Application_Error</tt> method in <tt>Global.asax</tt>.</p>
<pre class=csharp>
//Somewhere in Global.asax
protected void Application_Error()
{
  //Useful for debugging to get error details
  Exception ex = Server.GetLastError();

  //Redirect to error page
  //Can be "/Main/Error" or "/error" or other route as "ErrorPage" rule eats all
  Response.Redirect(Request.ApplicationPath + "/error/500");
}
</pre>
<h2>Configuration in IIS 7.5</h2>
<p>1. Open IIS Manager. Shortcut: click Start in Windows, type &#8220;inetmgr&#8221; in search box then press Enter.<br />
2. Click on a website on the left side.<br />
3. Select Error Pages on the right side.<br />
4. Configure scenarios for specific status codes, as displayed on screenshots.</p>
<p><a href="http://tech.avivo.si/2011/01/how-to-show-or-create-custom-404-error-page-in-asp-net-mvc/error-page-1/" rel="attachment wp-att-1351"><img src="http://tech.avivo.si/wp-content/uploads/2011/01/error-page-1-600x277.png" alt="" title="Configure Error Pages in IIS (1)" width="600" height="277" class="alignnone size-medium wp-image-1351" /></a></p>
<p><a href="http://tech.avivo.si/2011/01/how-to-show-or-create-custom-404-error-page-in-asp-net-mvc/error-page-2/" rel="attachment wp-att-1352"><img src="http://tech.avivo.si/wp-content/uploads/2011/01/error-page-2-600x277.png" alt="" title="Configure Error Pages in IIS (2)" width="600" height="277" class="alignnone size-medium wp-image-1352" /></a></p>
<h2>Troubleshooting</h2>
<p>Q: Browser displays system error page when I expect custom error page.<br />
A: Configure Error Pages for the website in IIS. Error Pages may differ between websites.</p>
<p>Q: Error handling is defined in web.config but does not work in Windows Server 2008.<br />
A: Try to edit Error Pages directly in IIS (IIS Manager -> Sites -> (website name) -> Error Pages)</p>
<p>Q: Status code 200 OK displays a custom error page but 404 Not Found displays generic IIS error page (yellow box with techical message)<br />
A: Configure Error Pages (see above). &#8220;customErrors&#8221; in web.config may not work as expected.</p>
<p>Q: Can I keep status 200 OK to display error page?<br />
A: It will do the job for users who visually see and understand the content, but may not work for bots (i.e. displaying error page in search result)</p>
<p><!--Simple as that, just register this route (and set right action in your controller) and voila!--><br />
<!--And if you want to catch also <strong>Compilation Errors</strong> (yellow screens with error messages) then you can catch all exceptions in your Global.asax.cs like this:&#8211;></p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2011/01/how-to-show-or-create-custom-404-error-page-in-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing URL query string into key-value pairs in C#</title>
		<link>http://tech.avivo.si/2010/12/parsing-url-query-string-into-key-value-pairs-in-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=parsing-url-query-string-into-key-value-pairs-in-c</link>
		<comments>http://tech.avivo.si/2010/12/parsing-url-query-string-into-key-value-pairs-in-c/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 12:08:31 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Programming Techniques]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[key-value pairs from query string]]></category>
		<category><![CDATA[parsing query string]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=917</guid>
		<description><![CDATA[Imagine you have URL something like this: http://www.yourdomain.com?param1=value1&#38;param2=value2&#38;param3=value3&#38;param4=value4 and you want to get key-value pairs such as {&#8220;param1&#8243;, &#8220;param2&#8243;, &#8220;param3&#8243;, &#8220;param4&#8243;} {&#8220;value1&#8243;, &#8220;value2&#8243;, &#8220;value3&#8243;, &#8220;value4&#8243;} It is easy to do using system function: using System.Collections.Specialized; NameValueCollection query = HttpUtility.ParseQueryString(queryString); Response.Write(query["param1"]);]]></description>
			<content:encoded><![CDATA[<p>Imagine you have URL something like this:</p>
<p><strong>http://www.yourdomain.com?param1=value1&amp;param2=value2&amp;param3=value3&amp;param4=value4</strong></p>
<p>and you want to get key-value pairs such as</p>
<ul>
<li>{&#8220;param1&#8243;, &#8220;param2&#8243;, &#8220;param3&#8243;, &#8220;param4&#8243;}</li>
<li>{&#8220;value1&#8243;, &#8220;value2&#8243;, &#8220;value3&#8243;, &#8220;value4&#8243;}</li>
</ul>
<p>It is easy to do using system function:</p>
<pre class=charp>
using System.Collections.Specialized;
NameValueCollection query = HttpUtility.ParseQueryString(queryString);
Response.Write(query["param1"]);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2010/12/parsing-url-query-string-into-key-value-pairs-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiler Error Message: CS0016: Could not write to output file &#8211; Temporary ASP.NET Files &#8211; Access is denied</title>
		<link>http://tech.avivo.si/2010/11/compiler-error-message-cs0016-could-not-write-to-output-file-temporary-asp-net-files-access-is-denied/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=compiler-error-message-cs0016-could-not-write-to-output-file-temporary-asp-net-files-access-is-denied</link>
		<comments>http://tech.avivo.si/2010/11/compiler-error-message-cs0016-could-not-write-to-output-file-temporary-asp-net-files-access-is-denied/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 13:30:31 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[Access is denied]]></category>
		<category><![CDATA[App_GlobalResources.xxxxxxx.dll]]></category>
		<category><![CDATA[Compiler Error Message]]></category>
		<category><![CDATA[CS0016: Could not write to output file]]></category>
		<category><![CDATA[iis 7 error]]></category>
		<category><![CDATA[iis error]]></category>
		<category><![CDATA[v2.0.50727\Temporary ASP.NET Files]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=808</guid>
		<description><![CDATA[Everything was working perfectly and then suddenly during ASP.NET (MVC) development you got this error from your IIS 7 server (in our case from Windows 7 64-bit): Compiler Error Message: CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\myapp\xxxxx\xxxxx\App_GlobalResources.xxxxxxx.dll’ — &#8216;Access is denied.&#8217; So, what goes wrong? You don&#8217;t know because it was working [...]]]></description>
			<content:encoded><![CDATA[<p>Everything was working perfectly and then suddenly during ASP.NET (MVC) development you got this error from your IIS 7 server (in our case from Windows 7 64-bit):<br />
<strong><span style="color: #ff0000;">Compiler Error Message: CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\myapp\xxxxx\xxxxx\App_GlobalResources.xxxxxxx.dll’ — &#8216;Access is denied.&#8217;</span></strong><br />
So, what goes wrong? You don&#8217;t know because it was working perfectly previous day, it is also compiles OK but not working anymore on your IIS webserver and, all you got, is yellow screen with this error message.</p>
<h4 style="margin-bottom: 25px;"><strong>We searched a little bit and found that the problem appeared because the permission were lost on following Temporary folders:</strong></h4>
<pre style="margin-bottom: 25px;" lang="text">C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\

C:\Windows\Temp
</pre>
<h4><strong>Recipe</strong></h4>
<ul>
<li>Gave a full permission to NETWORK SERVICE user to these folders (extreme case is to give full permission to Everyone user to these folders &#8211; do this only it doesn&#8217;t work)</li>
<li>Restart IIS using <strong>iisreset </strong>command</li>
</ul>
<p>IIS started to serve pages again&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2010/11/compiler-error-message-cs0016-could-not-write-to-output-file-temporary-asp-net-files-access-is-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publish on Twitter nice and easy from ASP.NET MVC (C#)</title>
		<link>http://tech.avivo.si/2010/09/publish-on-twitter-from-asp-net-mvc-csharp-nice-and-easy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=publish-on-twitter-from-asp-net-mvc-csharp-nice-and-easy</link>
		<comments>http://tech.avivo.si/2010/09/publish-on-twitter-from-asp-net-mvc-csharp-nice-and-easy/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 19:59:54 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Programming Techniques]]></category>
		<category><![CDATA[Social networks]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[change twitter status in c#]]></category>
		<category><![CDATA[dev.twitter.com]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[publish message on twitter from asp.net mvc or c#]]></category>
		<category><![CDATA[put message on twitter]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter authentication]]></category>
		<category><![CDATA[twitterizer]]></category>
		<category><![CDATA[twitting]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=614</guid>
		<description><![CDATA[How can you automatically post message to Twitter from C#, ASP.NET MVC (from your application)? First, setup new Twitter application under your Twitter account. Go to dev.twitter.com and login with your Twitter account Click on Add Application and enter the all needed data You will get all all needed secret keys and tokens and they [...]]]></description>
			<content:encoded><![CDATA[<p>How can you automatically post message to Twitter from C#, ASP.NET MVC (from your application)?</p>
<p>First, setup new Twitter application under your Twitter account.</p>
<ol>
<li>Go to <a href="http://dev.twitter.com" target="_blank">dev.twitter.com</a> and login with your Twitter account</li>
<li>Click on Add Application and enter the all needed data</li>
</ol>
<p>You will get all all needed secret keys and tokens and they are needed for automatic tweeting.</p>
<ul>
<li><strong>Consumer key:</strong> xxxxxxxxxxxxxxxxxxxxx</li>
<li><strong>Consumer secret:</strong> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</li>
<li><strong>Access Token (oauth_token):</strong> xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</li>
<li><strong>Access Token Secret (oauth_token_secret):</strong> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</li>
</ul>
<p>Now, download <a title="Twitterizer" href="http://www.twitterizer.net/downloads/" target="_blank">Twitterizer API</a></p>
<ol>
<li>reference <strong>Twitterizer2.dll</strong></li>
<li>Put this code into your application (of course change the location from where you get your secret keys &#8211; we have a <strong>Settings </strong> class)</li>
</ol>
<pre lang="csharp">public void PublishOnTwitter(string message)
{
	OAuthTokens tokens = new OAuthTokens();
	tokens.ConsumerKey = Settings.TwitterConsumerKey;
	tokens.ConsumerSecret = Settings.TwitterConsumerSecret;
	tokens.AccessToken = Settings.TwitterToken;
	tokens.AccessTokenSecret = Settings.TwitterTokenSecret;

	TwitterStatus status = TwitterStatus.Update(tokens, message);
}</pre>
<p>And that&#8217;s it!<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2010/09/publish-on-twitter-from-asp-net-mvc-csharp-nice-and-easy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF files not Publish in ASP.NET MVC when deploying</title>
		<link>http://tech.avivo.si/2010/06/pdf-files-not-publish-in-asp-net-mvc-when-deploying/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pdf-files-not-publish-in-asp-net-mvc-when-deploying</link>
		<comments>http://tech.avivo.si/2010/06/pdf-files-not-publish-in-asp-net-mvc-when-deploying/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 12:28:51 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[deploy web application]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdf files not published]]></category>
		<category><![CDATA[publish]]></category>
		<category><![CDATA[publish pdf files in asp.net mvc]]></category>

		<guid isPermaLink="false">http://tech.avivo.si/?p=523</guid>
		<description><![CDATA[We faced a problem when we added some PDF files into our media library of ASP.NET MVC website and noticed that these files are not Published automatically. So you need in Visual Studio to click on each PDF file and under Properties (F4) just choose Build Action=Content Copy to Output Directory=Copy Always]]></description>
			<content:encoded><![CDATA[<p>We faced a problem when we added some PDF files into our media library of ASP.NET MVC website and noticed that these files are not Published automatically.<br />
So you need in Visual Studio to click on each PDF file and under Properties (F4) just choose <strong></strong></p>
<ul>
<li><strong>Build Action=Content</strong></li>
<li><strong>Copy to Output Directory=Copy Always</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2010/06/pdf-files-not-publish-in-asp-net-mvc-when-deploying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparison: ASP .NET WebForms vs MVC</title>
		<link>http://tech.avivo.si/2010/01/comparison-asp-net-webforms-vs-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=comparison-asp-net-webforms-vs-mvc</link>
		<comments>http://tech.avivo.si/2010/01/comparison-asp-net-webforms-vs-mvc/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 22:41:44 +0000</pubDate>
		<dc:creator>Avivo</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[event model]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[view-model-controller]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.sweetucan.com/?p=132</guid>
		<description><![CDATA[Comparison: ASP .NET WebForms vs MVC WebForms MVC Requires .NET 2.0 Event model &#8211; button click triggers an event in code-behind ViewState &#8211; server-based forms for easier management Existing third party controls Requires .NET 3.5 and MVC library Requires IIS 6.0 or later for URL rewritting &#8211; btw, max IIS version for WinXP is 5.1 [...]]]></description>
			<content:encoded><![CDATA[<p>Comparison: ASP .NET WebForms vs MVC</p>
<table border="0">
<tbody>
<tr>
<td>WebForms</td>
<td>MVC</td>
</tr>
<tr style="vertical-align: top">
<td>
<ul>
<li>Requires .NET 2.0</li>
<li>Event model &#8211; button click triggers an event in code-behind</li>
<li>ViewState &#8211; server-based forms for easier management</li>
<li>Existing third party controls</li>
</ul>
</td>
<td>
<li><span style="color: #800000;">Requires .NET 3.5 and MVC library</span></li>
<li><span style="color: #800000;">Requires IIS 6.0 or later for URL rewritting &#8211; btw, max IIS version for WinXP is 5.1</span></li>
<li>Backward compatible &#8211; developer can include WebForms pages into MVC website and vice-versa</li>
<li>Dividing an application into the model, the view, and the controller &#8211; <span style="color: #008000;">data, design and code are separated</span></li>
<li>For large teams of developers and designers (parallel work)</li>
<li>No ViewState means <span style="color: #008000;">smaller output and cleaner html</span></li>
<li><span style="color: #008000;">Portable</span> among other languages (like php) &#8211; similar file hierarchy, object names, different syntax</li>
<li><span style="color: #008000;">30-50% faster than Web Forms, 100-800 requests per second</span></li>
<li>Native URL rewritting</li>
<li><span style="color: #008000;">Skinnable</span>, suitable for websites that are viewed in computer browsers and mobile browsers</li>
<li>Unit testing</li>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://tech.avivo.si/2010/01/comparison-asp-net-webforms-vs-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

