Rad Captcha not working with URL Rewriting

2 posts, 0 answers
  1. Aamir Ali Ansari
    Aamir Ali Ansari avatar
    22 posts
    Member since:
    Jun 2010

    Posted 12 Feb 2011 Link to this post

    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");
                 }
             }
         }
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 16 Feb 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top