Website works locally but not when deployed
=============== =============== ====
Can someone please help with what I hope is a common problem (I’m new to .net).
I have a simple website generated by Visual studio 2005 .NET
It has a custom handler because I need to poll my website and update the browser page every few seconds.
I have developed the project locally and everything is working FINE!
However … when I publish to my Website instead of getting my fresh data into the browser (IE) I get the handler HTML data ie the .aspx page HTML!
Do I need to do something with IIS? ( a grey area for me). If so I would be concerned if all users would need to make changes…
After 3 days hair pulling any ideas would be extremely welcome…
Visual studio 2005 Project
=============== =======
MyProject
Folder App_Code
CaptionHandler. cs
CaptionHandler. aspx.cs
Folder App_Data
CaptionHandler. aspx
CaptionHandler. aspx.cs
Default.aspx
Default.aspx.cs
Web.Config
XMLHTTP requesting
=============== =======
var http = getHTTPObject() ;
var URL = "CaptionHandler .aspx?rat=bad&d og=good”;
http.open("GET" , URL, true);
wait (http.readyStat e == 4) etc
var string = http.responseTe xt;
send(null);
CaptionHandler. aspx is shell page
CaptionHandler. cs is :
=============== ====
using System;
using System.Data;
using System.Configur ation;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
using System.Runtime. InteropServices ;
using System.Text;
/// <summary>
/// Summary description for CaptionHandler
/// </summary>
///
namespace MyHandler
{
public class CaptionHandler : IHttpHandler
{
public CaptionHandler( ){}
#region IHttpHandler Members
public void ProcessRequest( HttpContext context)
{
context.Respons e.ContentType = "text/plain";
string sVerb = context.Request .QueryString["…"];
string sCaption = context.Request .QueryString["…"];
context.Respons e.Write(sVerb);
context.Respons e.Write(sCaptio n);
}
}
public bool IsReusable
{
get { return true; }
}
#endregion
}
}
web.config
=============== =======
<httpHandlers >
<add verb="*" path="CaptionHa ndler.aspx" type="MyHandler .CaptionHandler " />
</httpHandlers>
Fingers crossed ....
=============== =============== ====
Can someone please help with what I hope is a common problem (I’m new to .net).
I have a simple website generated by Visual studio 2005 .NET
It has a custom handler because I need to poll my website and update the browser page every few seconds.
I have developed the project locally and everything is working FINE!
However … when I publish to my Website instead of getting my fresh data into the browser (IE) I get the handler HTML data ie the .aspx page HTML!
Do I need to do something with IIS? ( a grey area for me). If so I would be concerned if all users would need to make changes…
After 3 days hair pulling any ideas would be extremely welcome…
Visual studio 2005 Project
=============== =======
MyProject
Folder App_Code
CaptionHandler. cs
CaptionHandler. aspx.cs
Folder App_Data
CaptionHandler. aspx
CaptionHandler. aspx.cs
Default.aspx
Default.aspx.cs
Web.Config
XMLHTTP requesting
=============== =======
var http = getHTTPObject() ;
var URL = "CaptionHandler .aspx?rat=bad&d og=good”;
http.open("GET" , URL, true);
wait (http.readyStat e == 4) etc
var string = http.responseTe xt;
send(null);
CaptionHandler. aspx is shell page
CaptionHandler. cs is :
=============== ====
using System;
using System.Data;
using System.Configur ation;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
using System.Runtime. InteropServices ;
using System.Text;
/// <summary>
/// Summary description for CaptionHandler
/// </summary>
///
namespace MyHandler
{
public class CaptionHandler : IHttpHandler
{
public CaptionHandler( ){}
#region IHttpHandler Members
public void ProcessRequest( HttpContext context)
{
context.Respons e.ContentType = "text/plain";
string sVerb = context.Request .QueryString["…"];
string sCaption = context.Request .QueryString["…"];
context.Respons e.Write(sVerb);
context.Respons e.Write(sCaptio n);
}
}
public bool IsReusable
{
get { return true; }
}
#endregion
}
}
web.config
=============== =======
<httpHandlers >
<add verb="*" path="CaptionHa ndler.aspx" type="MyHandler .CaptionHandler " />
</httpHandlers>
Fingers crossed ....
Comment