2009-10-10 15 views
4

Mondor的MSCaptcha控件在本地開發機器上運行並顯示,但在部署到共享服務器託管服務時不顯示其生成的圖像。Mondor的MSCaptcha在部署到託管服務時不會加載映像

//什麼我的web.config說:

<handlers> 
<add name="MSCaptchaImage" 
    path="CaptchaImage.axd" 
    verb="GET" 
    type="MSCaptcha.CaptchaImageHandler, MSCaptcha" 
    preCondition="integratedMode,runtimeVersionv2.0"/> 
</handlers> 

是的,我的FTP .dll文件(S)到主機服務器上的bin目錄,我從IIS7在Vista上運行的本地代碼運行正常。任何其他你可能需要幫助請問,但我需要弄清這一個,因爲我很難過,並注意到我無法控制服務器在主機供應商

注意:我觀察到其他人有這個問題作爲對asp.net [1]的迴應,幸運的是我的Passport和Windows DeadOnArrival證書都完全是FUBAR,asp.net甚至不會發給我一個忘記的密碼,因爲它不再瞭解我,所以我可以' t在asp.net論壇中獲得involed。

[1] http://forums.asp.net/p/1468509/3395243.aspx

回答

0

如果您使用窗體身份驗證,然後它可能是一個權限問題,那麼試試這個:

http://www.aspsnippets.com/post/2009/04/03/How-to-implement-Captcha-in-ASPNet.aspx#id_9f698584-ecb7-4fa1-99f5-797ee1a8f593

+0

這些都是我在幾個月前跟着方向和控制運行良好在我的本地開發機。注意ASP.NET重新配置web.config文件,並且不再有部分,所有內容都動態地重定位到部分。 非常感謝,但問題仍然存在 – 2009-10-10 15:13:40

3

如果使用形式的認證,那麼你可能無法看到圖像。要解決此插件,

<位置路徑= 「CaptchaImage.axd」 >
  <的System.Web >
    <授權>
      <允許用戶= 「*」/ >
    < /授權>
  </system.web>
< /位置>

本節在web.config

4

這爲我工作,修改你的web.config文件

第一節

<system.webServer> 
    <handlers> 
     <add name="MSCaptcha" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/> 
    </handlers> 
</system.webServer> 

第二節

<system.web> 
    <httpHandlers> 
     <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/> 
    </httpHandlers> 
</system.web> 
7

明白了...

Web.config文件是大小寫敏感的。所以在captchaImageHandler改變大寫字母 「C」 小 「C」

變化:TYPE =「MSCaptcha * 。 C * aptchaImageHandler,MSCaptcha「 To:type =」MSCaptcha。* ç * aptchaImageHandler,MSCaptcha」

希望這會爲你工作.. 編碼快樂... :)

+0

這真的很有用。 – BigMan 2014-04-28 07:30:10

+0

很好的接收!是無知的事情發生..謝謝! – Naga 2016-01-30 13:35:37

1

此路徑應該是這樣的:path="/CaptchaImage.axd"system.webServer

<system.webServer> 
    <handlers> 
    <add name = " MSCaptcha" verb = "GET" path = "/CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler,MSCaptcha"/> 
    </handlers> 
</system.webServer> 
1

我有兩個網絡CONFIGS,在子文件夾中的config其中使用驗證碼的頁面與權利的配置更新。

<location path="CaptchaImage.axd"> 
    <system.web> 
    <authorization> 
    <allow users="*" /> 
    </authorization> 
    </system.web> 
</location> 

解決了這個問題。

0

我有同樣的問題,我使用asp.net 5.0 vs2013
我改變了我的web.config如下

<system.web> 
<httpHandlers> 
     <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.captchaImageHandler, MSCaptcha"/> 
    </httpHandlers> 
    <system.webServer> 
     <handlers> 
<add name="CAPTCHAHandler" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.captchaImageHandler, MSCaptcha" /> 
    </handlers> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    </system.webServer> 
    <location path="CaptchaImage.axd"> 
    <system.web> 
     <authorization> 
     <allow users="*"/> 
     </authorization> 
    </system.web> 
    </location> 

三個轉變到我的web.config,並更新了一個dll變化 。從1.0至4.0 添加處理程序DLL來的system.webserver 新增

</system.webServer> 
    <location path="CaptchaImage.axd"> 
    <system.web> 
     <authorization> 
     <allow users="*"/> 
     </authorization> 
    </system.web> 
    </location> 

在MSCaptcha改變C 1至C ** C ** aptchaImageHandler

它在我的開發箱和本地工作。

0

我已經解決了我的問題。由於Web.config區分大小寫,所以在編輯時請小心。這是2部分的代碼。

<httpHandlers> 
     <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/> 
</httpHandlers> 

,並確保你把着爲路徑值斜槓(/)

<system.webServer> 

    <handlers> 

     <add name="MSCaptcha" verb="GET" path="/CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/> 

    </handlers> 

</system.webServer> 
相關問題