Why do I get the following server exception (500 response) when calling GetResponse() (HttpWebRequest) on a page with a WebDatePicker on it?
Exception information: Exception type: FormatException Exception message: 'auto' cannot be parsed as a unit as there are no numeric values in it. Examples of valid unit strings are '1px' and '.5in'. at System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType) at System.Web.UI.Html32TextWriter.ConvertToHtmlSize(String value) at System.Web.UI.Html32TextWriter.OnStyleAttributeRender(String name, String value, HtmlTextWriterStyle key) at System.Web.UI.HtmlTextWriter.FilterAttributes() at System.Web.UI.HtmlTextWriter.RenderBeginTag(HtmlTextWriterTag tagKey) at System.Web.UI.Html32TextWriter.RenderBeginTag(HtmlTextWriterTag tagKey) at Infragistics.Web.UI.EditorControls.TextEditorRenderer.RenderButton(HtmlTextWriter writer, Int32 type, String css) at Infragistics.Web.UI.EditorControls.TextEditorRenderer.RenderTableControl(HtmlTextWriter writer) at Infragistics.Web.UI.EditorControls.TextEditorRenderer.RenderContents(HtmlTextWriter writer) at Infragistics.Web.UI.Framework.RunBot.HandleRenderContents(HtmlTextWriter writer, RendererBase renderer) at Infragistics.Web.UI.Framework.ControlMain.RenderContents(HtmlTextWriter writer) at Infragistics.Web.UI.Framework.ControlMain.Render(HtmlTextWriter writer) at Infragistics.Web.UI.EditorControls.WebTextEditor.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) at System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Infragistics4.Web.v11.1, Version=11.1.20111.1006
I call GetResonse() from a separate WinForms application that I use to poll various web applications to determine their status. The code is essentially this:
// Create a HttpWebRequest to check for response
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://" + url);
webRequest.Timeout = Constants.ResponseTimout;
webRequest.Credentials = CredentialCache.DefaultCredentials;
NetworkCredential nc = CredentialCache.DefaultNetworkCredentials;
WebProxy proxy = new WebProxy("http://" + url);
proxy.Credentials = nc;
webRequest.Proxy = proxy;
try
{
using(HttpWebResponse resp = (HttpWebResponse)webRequest.GetResponse())
if(resp.StatusCode == HttpStatusCode.OK)
return true;
else
return false;
}
catch(Exception e2)
LogError(string.Format("*** ERROR CHECKING APP FOR RESPONSE ***{0}{1}{0}",
CRLF, e2.Message), e2);
Hello FireStorm12,
Can you tell me what version and what build is the “WebDatePicker” control that you use in your application?
Also where in your code (in what event) do you call “GetResponse()” method?
If you can send me a simple example or code snippet that can allow me to reproduce this behavior it will be very useful in quickly identifying the cause of this exception.
I am looking forward to hearing from you.