This is a migrated thread and some comments may be shown as answers.

Rad Captcha not working with URL Rewriting

1 Answer 103 Views
Captcha
This is a migrated thread and some comments may be shown as answers.
Aamir Ali Ansari
Top achievements
Rank 2
Aamir Ali Ansari asked on 12 Feb 2011, 08:43 AM
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.
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");
             }
         }
     }

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 16 Feb 2011, 09:47 AM
Hello Aamir,

I suppose the problem comes from the fact that the URL of the CaptchaImage is not rewritten correctly, and the image is not shown on the control. Similar problem have been reported in the following forum thread: http://www.telerik.com/community/forums/aspnet-ajax/captcha/enablerefreshimage-with-isapirewrite.aspx.
If the forum thread does not help you resolve the problem, please open a new support ticket and send us a fully working sample project that demonstrates the issue, so we are able to debug the problem locally.

I tried to run your code locally, but was not able because the definition of the DataAccessLayer object is missing.

All the best,
Pero
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Captcha
Asked by
Aamir Ali Ansari
Top achievements
Rank 2
Answers by
Pero
Telerik team
Share this question
or