I am using RadCaptcha in simple asp user control. It is working fine in normal conditions but stop working when accessed through url rewrtten address. Can you please suggest what is required to fix this problem. I am using asp.net 4.0 on iis7. I cannot find any appropriate property to fix this. Furthermore, I am not using web config to write rules, instead my rules are saved in database and urls are being handled using resolveurl.
Following is a code used in Global.asax to give you an idea of the way I am implementing url rewriting.
Following is a code used in Global.asax to give you an idea of the way I am implementing url rewriting.
void Application_BeginRequest(object sender, EventArgs e)
{
// URLRewrtingEnabled
string ue = "";
try
{
ue = System.Configuration.ConfigurationManager.AppSettings["URLRewrtingEnabled"].ToString();
}
catch (Exception ex)
{
ue = "";
}
if (ue.ToLower() == "true")
{
string fullOrigionalpath = Request.Url.ToString();
DataAccessLayer Dal = new DataAccessLayer();
Activity act = new Activity();
string st, sv, sn, dp, sn2;
st = Dal.GetDefautURL(); // Site name
sn = Request.ServerVariables["SERVER_NAME"].ToString(); // Server name
string ds = Dal.getDestinationURL(sn, st, fullOrigionalpath);
if (ds != "")
{
try
{
Context.RewritePath(ds);
}
catch (Exception ex)
{
Dal.ErrorLog(ex.Message, "URL Rewrite");
}
}
}