﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
9788	ASP.NET 3.6.4 & HTMLEncodeOutput=False will not postback correctly	Ross		"In the IPostBackDataHandler.LoadPostData() method, the code will not save the posted value when htmlEncodeOutput=false .


{{{
bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
{
	if (this.config.htmlEncodeOutput)
	{
		string postedValue = HttpUtility.HtmlDecode(postCollection[postDataKey]);
		if (this.Text != postedValue)
		{
			isChanged = true;
			this.Text = postedValue;
			return true;
		}
	}
	return false;
}
}}}


Since this is false: 
{{{
if (this.config.htmlEncodeOutput)
}}}
The code will never execute, therefore the value is not saving to:

{{{
string postedValue =...
isChanged = true;
this.Text = postedValue;
}}}
 
Change the procedure to the following and it started saving again:


{{{
bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
{
	string postedValue = this.config.htmlEncodeOutput ? HttpUtility.HtmlDecode(postCollection[postDataKey]) : postCollection[postDataKey];
	if (this.Text != postedValue)
	{
		isChanged = true;
		this.Text = postedValue;
		return true;
	}

	return false;
}

}}}

The key is that regardless of the htmlencodeoutput value set the post collection saves to the postedValue 

{{{
string postedValue = this.config.htmlEncodeOutput ? HttpUtility.HtmlDecode(postCollection[postDataKey]) : postCollection[postDataKey];
}}}


Please Note, I am using the ASP.NET 3.6.4 code base with the 4.0 version of CKEditor"	Bug	confirmed	Normal		Server : ASP.Net				
