Parser Error - Adding a new page to the project

Last post 06-10-2006, 12:02 PM by cutechat. 5 replies.
Sort Posts: Previous Next
  •  06-07-2006, 11:06 AM 19874

    Parser Error - Adding a new page to the project

    Hi,

    So, I got the web messenger working on our server.  Of course, I don't want cutesofts default.aspx page.  I want to integrate ONLY the web messenger into our existing website.  So I reviewed the cutesoft code a bit and added a testpage.  Here's the code:

    - testpage.aspx

        <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestPage.aspx.vb" Inherits="TestPage" %>

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"        
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <html xmlns="http://www.w3.org/1999/xhtml" >
        <head runat="server">
            <title>Untitled Page</title>
        </head>
        <body>
            <form id="form1" runat="server">
            <div>
                <asp:Label ID="lblWelcome" runat="server" Text="Welcome, " Width="302px"></asp:Label><br />
                <br />
                <asp:Button ID="btnLaunch" runat="server" Text="Launch IM" Width="150px" />&nbsp;<br />
                <br />
                <asp:TextBox ID="txtAddBuddy" runat="server"></asp:TextBox>
                <asp:Button ID="btnAddBuddy" runat="server" Text="Add User" Width="150px" /><br />
                <br />
                <asp:Label ID="lblUserID" runat="server" Text="UserID: " Width="301px"></asp:Label><br />
                <br />
                <asp:Label ID="lblError" runat="server" ForeColor="Red" Height="198px" Width="300px"></asp:Label></div>
            </form>
        </body>
        </html>





    - testpage.aspx.vb

    Imports CuteSoft.Chat

    Partial Class TestPage
        Inherits System.Web.UI.Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            lblWelcome.Text &= ChatApi.GetUser(ChatWebUtility.CurrentIdentity.UniqueName).ToString
        End Sub

        Protected Sub btnAddBuddy_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddBuddy.Click

            Dim usrMe As CuteChatUser = ChatApi.GetUser(ChatWebUtility.CurrentIdentity.UniqueName)
            Dim usrBuddy As New CuteChatUser
            usrBuddy.UniqueName = txtAddBuddy.Text

            lblUserID.Text &= usrBuddy.UserId

            If (usrMe.UserId = usrBuddy.UserId) Then
                lblError.Text = "You can't add yourself."
            ElseIf (usrMe.UserId = 0) Then
                lblError.Text = "No user found."
            Else
                ChatApi.AddContact(usrMe.UserId, usrBuddy.UserId)
            End If

        End Sub

    End Class




    - web.config

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
            <section name="CutePortalConfig" type="CutePortal.Config.CutePortalConfig, CutePortal" />
        </configSections>
        <CutePortalConfig>       
            <add key="DALAssembly" value="CutePortal" />
            <add key="DALNamespace" value="CutePortal.SqlScopeDAL" />       
            <add key="PasswordLength" value="10" />
            <add key="NewTopicTimeSpan" value="5" />
            <add key="DefaultRank" value="DefaultRank" />
        </CutePortalConfig>
        <appSettings>
              <!-- Connection String for SQL Server -->
            <add key="ConnectionString" value="server=stuffhere"/>
        </appSettings>
        <system.web>
            <httpModules>
                <add name="CuteSoft.Chat" type="CuteSoft.Chat.EasyHttpZipModule,CuteSoft.Chat" />
            </httpModules>
            <pages validateRequest="false" />
            <compilation defaultLanguage="c#" debug="true" />
            <customErrors mode="Off" />
            <authentication mode="Forms" />
            <authorization>
                <allow users="*" />
            </authorization>
            <trace enabled='true'></trace>
            <sessionState mode="InProc" timeout="20" />
            <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
        </system.web>
    </configuration>


    - directory structure (not sure if this is right or what i need or don't need)

    localhost/admin
    localhost/avatars
    localhost/languages
    localhost/theme
    localhost/cutesoftclient
    localhost/bin



    this is the error i'm getting:

    Server Error in '/' Application.

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Could not load type 'TestPage'.

    Source Error:

    Line 1:  <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestPage.aspx.vb" Inherits="TestPage" %>
    Line 2:
    Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Source File: TestPage.aspx    Line: 1


    Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300




    Thanks in advance...
  •  06-07-2006, 11:38 AM 19875 in reply to 19874

    Re: Parser Error - Adding a new page to the project

    Can someone please help me with this...

    Not sure why but when I do it locally it gives me a more refined error:

    Missing appSetting:CuteChat.SqlClient.ConnectionString

    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.Exception: Missing appSetting:CuteChat.SqlClient.ConnectionString

    Source Error:

    Line 6:  
    Line 7: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Line 8: lblWelcome.Text &= ChatApi.GetUser(ChatWebUtility.CurrentIdentity.UniqueName).ToString
    Line 9: End Sub
    Line 10:




    So is it because of my web.config connectionstring?

    <appSettings>
        <!-- Connection String for SQL Server -->
        <add key="ConnectionString" value="server=stuffhere"/>
     </appSettings>

    I'm using VS.NET 2005... connection strings aren't accessed differently from web.config.

    Somebody please help!  Thanks.
  •  06-07-2006, 12:36 PM 19879 in reply to 19875

    Re: Parser Error - Adding a new page to the project

    Can somebody please help... am I talking to myself here?

    Okay, so somehow its working locally (file system) but not on IIS (remote server).  I'll deal with that later.

    But how do you add a user to your buddy list?
    What function returns the UserID based on a unique name and vice versa?

    I tried this:
        Dim myUserName = "MyUniqueName"
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim usrMe As CuteChatUser = ChatApi.GetUser(myUserName)
            lblWelcome.Text = "Welcome, "
            lblWelcome.Text &= usrMe.DisplayName & ". "
            lblWelcome.Text &= vbCr & "UserID: " & usrMe.UserId
        End Sub

    If you purchase the web messenger does it come with more documentation?  The current documentation doesn't seem like enough...

  •  06-07-2006, 12:42 PM 19880 in reply to 19879

    Re: Parser Error - Adding a new page to the project

    Where does it link the buddy lists (relationship in db?)?
    what are all these tables in the db?

  •  06-07-2006, 12:44 PM 19881 in reply to 19880

    Re: Parser Error - Adding a new page to the project

    how do u check if a user exists?  GetUser creates a new user if the user doesn't exist?..........
  •  06-10-2006, 12:02 PM 19995 in reply to 19881

    Re: Parser Error - Adding a new page to the project

    Jon.Lee  :
     
    Hello , I have checked your threads .
     
    The primary problem is that you haven't write the integration code for CuteChat (I guess) .
     
    Can you send me a mail ?
     
    I will send you a VB version integration code example . based on Asp.net2 membership .
     
    cutechat @ cutesoft.net
     
    Regards , Terry .
View as RSS news feed in XML