PDA

View Full Version : خطای Ambiguous match found......



tayebeh
یک شنبه 16 اسفند 1383, 07:27 صبح
با سلام به همه دوستان
من می خواستم از روش formsauthenticate برای صفحاتم استفاده کنم . یک صفحه به نام test.aspx و یک صفحه به نام login.aspx درست کردم و چناچه بدون وارد شدن از طریق login.aspx به خواهد به صفحه test وارد شود به صفحه login فرستاده میشود . ولی مشکل اینجاست که وقتی به سراغ صفحه test می روم این error عجیب غریب رو می ده .

<span dir=ltr>Server Error in '/Formsauth' Application.
--------------------------------------------------------------------------------

Ambiguous match found.
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.Reflection.AmbiguousMatchException: Ambiguous match found.

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:


[AmbiguousMatchException: Ambiguous match found.]
System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) +245
System.Type.GetProperty(String name, BindingFlags bindingAttr) +24
System.Web.UI.Util.GetNonPrivatePropertyType(Type classType, String propName)
System.Web.Compilation.TemplateControlCompiler.Bui ldFieldDeclaration(ControlBuilder builder, Boolean fGeneratedID)
System.Web.Compilation.TemplateControlCompiler.Bui ldSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse)
System.Web.Compilation.TemplateControlCompiler.Bui ldSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse)
System.Web.Compilation.TemplateControlCompiler.Bui ldMiscClassMembers()
System.Web.Compilation.PageCompiler.BuildMiscClass Members()
System.Web.Compilation.BaseCompiler.BuildSourceDat aTree() +1291
System.Web.Compilation.BaseCompiler.GetCompiledTyp e() +129
System.Web.Compilation.PageCompiler.CompilePageTyp e(PageParser pageParser)
System.Web.UI.PageParser.CompileIntoType()
System.Web.UI.TemplateParser.GetParserCacheItemThr oughCompilation() +126

[HttpException (0x80004005): Ambiguous match found.]
System.Web.UI.TemplateParser.GetParserCacheItemInt ernal(Boolean fCreateIfNotFound) +692
System.Web.UI.TemplateParser.GetParserCacheItemWit hNewConfigPath() +125
System.Web.UI.TemplateParser.GetParserCacheItem() +88
System.Web.UI.TemplateControlParser.CompileAndGetP arserCacheItem(String virtualPath, String inputFile, HttpContext context) +116
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String virtualPath, String inputFile, HttpContext context) +36
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context, String requestType, String url, String path) +44
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute() +95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&amp; completedSynchronously) +173




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
</span>

در صفحه test فقط یک button دارم .که در قسمت کلیک اون اینو نوشتم :
<span dir=ltr>FormsAuthentication.SignOut()
Response.Redirect("\formsauth\login.aspx")
</span>
و در page_loade هم اینو نوشتم :
<span dir=ltr>user.Text = "username is" &amp; Page.User.Identity.Name &amp; "."
</span>
ولی نمی دونم چرا error می ده .
با تشکر
بای

Behrouz_Rad
یک شنبه 16 اسفند 1383, 21:43 عصر
http://www.kbalertz.com/Feedback_823194.aspx

h_rezaei
یک شنبه 16 اسفند 1383, 22:52 عصر
اسم پروژه هم test هست؟
احتمالا اسم فایل سولوشن با یکی از فرمهات همنامه خلاصه یه چیزی Ambiguous داره

tayebeh
سه شنبه 18 اسفند 1383, 10:07 صبح
باسلام
مشکل قبلی من حل شد ولی یه مشکل جدید که دارم اینه که یه پوشه به نام admin به پروژه ام اضافه کردم و یک صفحه a.aspx و یه فایل وب کانفیگ گذاشتم که بصورت زیر در اون تنظیماتمو نوشتم :

<span dir=ltr>&lt;authorization>
&lt;allow users="amin" >
&lt;/allow>

&lt;deny users="*">&lt;/deny>


&lt;/authorization>
</span>
ولی وقتی با یوزر admin وارد می شم و می خوام به صفحه a.aspx برم دوباره به صفحه login بر می گردم .
اصلا نمی تونم نه با یوزر admin و نه هیچ یوزر دیگه ای به صفحه خاص خودش برم همه اش به صفحه login بر می گردم . :( :( :( :( :( :( :( :(
چیکار کنم ؟
با تشکر
بای