locked
Sharepoint 2010 - Custom Login Page using ASP.Net 2010 error, "Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValue RRS feed

  • Question

  • Hi

    I'm creating a Custom Login page using asp.net net, but i'm having this error:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Exception of type 'System.ArgumentException' was thrown.
    Parameter name: encodedValue 
    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.ArgumentException: Exception of type 'System.ArgumentException' was thrown.
    Parameter name: encodedValue

    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: 


    [ArgumentException: Exception of type 'System.ArgumentException' was thrown.
    Parameter name: encodedValue]
       Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue) +26168822
       Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedSuffix) +79
       Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) +27616569
       Microsoft.SharePoint.SPWeb.InitializeSPRequest() +223
       Microsoft.SharePoint.WebControls.SPControl.EnsureSPWebRequest(SPWeb web) +365
       Microsoft.SharePoint.WebControls.SPControl.SPWebEnsureSPControl(HttpContext context) +520
       Microsoft.SharePoint.ApplicationRuntime.BaseApplication.Application_PreRequestHandlerExecute(Object sender, EventArgs e) +351
       Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea) +60
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

    Here's my code

    <%@ Page Title="Welcome to Online Payroll Reports System - Login" Language="VB" MasterPageFile="~/_layouts/Custom-Master.Master" AutoEventWireup="false" %>
    <%@ Import Namespace="System.Web.Security" %>
    
    <script runat="server">
    
        'Dim MySQLMemberShipProvider As Membership
        
        Public Sub CmdLogin_OnClick(ByVal sender As Object, ByVal args As EventArgs)
            If (Membership.ValidateUser(TextboxUser.Text, TextboxPassword.Text)) Then
                FormsAuthentication.RedirectFromLoginPage(TextboxUser.Text, True)
                
            Else
                Msg.Text = "Login failed, Please check your username and password and try again"
            End If
        End Sub
        
    </script>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style type="text/css">
            .style5
            {
                width: 602px;
                height: 302px;
            }
            .style6
            {
                font-family: Arial, Helvetica, sans-serif;
                font-size: x-small;
                width: 599px;
            }
            .style7
            {
                width: 272px;
                height: 15px;
            }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <p>
            <img alt="" class="style5" src="Picture3.PNG" /></p>
        <p class="style6">
            © 2012 Isla Lipana &amp; Co. All rights reserved. Isla Lipana &amp; Co. is the 
            Philippine member firm of the PwC (PricewaterhouseCoopers) global network. “PwC” 
            refers to the network of member firms of PricewaterhouseCoopers International 
            Limited, each of which is a separate and independent legal entity.</p>
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
        <p>
            <img alt="" class="style7" src="ForLine.JPG" /></p>
        <asp:Label ID="Label1" runat="server" 
            style="font-family: Georgia; font-size: small" Text="Username:"></asp:Label>
        <br />
        <asp:TextBox ID="TextboxUser" runat="server" 
            style="font-family: Georgia; font-size: small"></asp:TextBox>
        <br />
        <br />
        <asp:Label ID="Label2" runat="server" 
            style="font-family: Georgia; font-size: small" Text="Password:"></asp:Label>
        <br />
        <asp:TextBox ID="TextboxPassword" runat="server" 
            style="font-family: Georgia; font-size: small" TextMode="Password"></asp:TextBox>
        <br />
        <br />
        <asp:Button ID="CmdLogIn" runat="server" 
            style="font-family: Georgia; font-size: small" Text="Log-In" OnClick="CmdLogin_OnClick" />
        <br />
        <br />
        <asp:Label ID="Msg" runat="server" 
            style="font-family: Georgia; font-size: small; color: #FF0000"></asp:Label>
    </asp:Content>

    did i missed something? i hope someone can help me on this, thanks.


    • Edited by Aron29 Monday, September 24, 2012 4:32 AM
    Monday, September 24, 2012 4:20 AM