PDA

View Full Version : سوال: یه مشکل عجیب در captcha در هنگام استفاده در سرور



dehqhani
یک شنبه 12 مرداد 1393, 18:08 عصر
سلام

من با کامپوننت زیر یه کپتچا ساختم کار میکنه ولی بعضی مواقع که خطا زیر را میدهد

از کد زیر خطا میگیره

( CaptchaControl2.ValidateCaptcha(tbCode.Text);)


Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
MSCaptcha.CaptchaControl.ValidateCaptcha(String userEntry) +146
Login2.btnEnter_Click(Object sender, EventArgs e) +326
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +153
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3706

En_MK
یک شنبه 12 مرداد 1393, 18:37 عصر
سلام
چک می کنید که تکس باکسی که کلمه امنیتی یا همون کپچا درش وارد میشه null نباشه؟

منبع (http://forums.asp.net/t/1945988.aspx?Object+reference+not+set+to+an+instan ce+of+an+object+C+)

fakhravari
یک شنبه 12 مرداد 1393, 19:17 عصر
NullReferenceException
یه مقدار خراب داره میره

dehqhani
یک شنبه 12 مرداد 1393, 20:50 عصر
من فقط وقتی چند بار اشتباه وارد کردم این اتفاق میفته

حتی اگه بعد چند بار اشتباه وارد کردن کد بیام کد تشویر رو درست هم وارد کنم این اتفاق میفته