On my local development server, I am running version 2.0.50727.4955 on the live server I am running 2.0.50727.42.
On my live server I get:
Compiler Error Message: CS0117: ‘System.Web.UI.HtmlControls.HtmlForm’ does not contain a definition for ‘Action’
On my development server everything works fine. Is this a .NET version issue or something else? Is there a way to make this work on my liver server with its current .Net version? Is there a way to upgrade from 2.0.50727.42 to 2.0.50727.4955?
Thanks
EDIT (Code):
if (Request.PathInfo.Length != 0)
{
string reqPath = Request.PathInfo;
string raw = Request.RawUrl;
string url = Request.Url.ToString();
if (reqPath.Length > 0)
url = url.Replace(reqPath, "");
if (raw.Length > 0)
url = url.Replace(raw, "");
litBasePath.Text = "<base href=\"" + url + "\">";
Page.Form.Attributes["Action"] = raw;
}
EDIT (Local Setup)
This is my local setup. I am not getting any compile errors when i run this locally.



HtmlForm.Action does not exist in the unpatched 2.0 framework. Only in 2.0 sp2+. My guess is that your local environment you’re building as a 3.5 app and using libraries that do not exist in your live environment.
In order set/change Action, I believe you need to use
Page.Form.Attributes["action"] = "Some URL Here"Or, if it’s possible, patch your server (recommended) or install the .NET 3.5 Framework. in your live environment.