سلام،
(امروز چقدر سلام کردم)
من در پروژه م از کنترل ویزارد استفاده کردم.
و یک کنترل لوگین گذاشتم تعیین کردم کاربر در اولین قدم ویزارد(step0)باید لوگین کنه.
اما اگر در حال حاضر کاربرلوگین هست که میره به قدم دوم .
حالا نمی دونم چرا گاهی از این کنترل لوگین خطا می گیره:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30311: Value of type 'login' cannot be converted to 'System.Web.UI.WebControls.Login'.
Source Error:
Line 69: If e.CurrentStepIndex = 0 Then
Line 70:
Line 71: Dim l As System.Web.UI.WebControls.Login = CType(Wizard1.FindControl("Login1"), Login)
Line 72:
Line 73: If Membership.ValidateUser(l.UserName, l.Password) Then
Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArg s)
Trace.Write(“next: CurrentStep”, e.CurrentStepIndex.ToString())
If e.CurrentStepIndex = 0 Then
Dim l As System.Web.UI.WebControls.Login = CType(Wizard1.FindControl(“Login1”), Login)
If Membership.ValidateUser(l.UserName, l.Password) Then
FormsAuthentication.SetAuthCookie(l.UserName, l.RememberMeSet)
e.Cancel = False
Else
Trace.Write(l.UserName, l.Password)
l.InstructionText = “Your login attempt was not successful. Please try again.”
l.InstructionTextStyle.ForeColor = System.Drawing.Color.Red
e.Cancel = True
End If
Else
If Not User.Identity.IsAuthenticated Then
e.Cancel = True
Wizard1.ActiveStepIndex = 0
End If
End If
گاهی مثل اینکه بعداز 10 دقیقه بیام پای کامپیوتر یا از توی صفحه های دیگه بیام این قسمت و... این خطا پیدا میشه یا اگه یه راست پروژه رو از این فایل اجرا کنم این خطا دیده میشه.
(نمی دونم درست و حسابی؛ توی بعضی حالتهای کار می کنه بعضی حالتها نه.)