YAFLogo

eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago

Do you mean the top logout button inside the sample application, or the logout button from the yaf menu?

Originally Posted by: tha_watcha 

The top logout button. The one from the yaf menu works fine.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago
eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago
Okay, I think we got this puppy humming now! Just one last thing and I think we'll be all set. See here:

https://www.intanibase.com/index.aspx 

As you can see, I have a login/out link on the page. The code is:

(ASPX)

 

<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
        <AnonymousTemplate>
            <asp:Button id="LoginLink" runat="server" CssClass="headerButton" Text="Login" OnClick="LoginLink_OnClick" /> 
            <asp:Button id="RegisterLink" runat="server"  CssClass="headerButton" Text="Register" OnClick="RegisterLink_OnClick" /> 
            <asp:Button id="settings" runat="server" CssClass="headerButton" Text="Settings" OnClick="goToSettings" />
        </AnonymousTemplate>
        <LoggedInTemplate>
            <span class="headerButton">Welcome  <asp:LoginName ID="HeadLoginName" runat="server" /></span> 
            <asp:LoginStatus ID="HeadLoginStatus" runat="server"  CssClass="headerButton" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/" /> 
            <asp:Button id="settings" runat="server" CssClass="headerButton2" Text="Settings" OnClick="goToSettings" />
        </LoggedInTemplate>
    </asp:LoginView>
             

             

           

       

       

            Welcome   

             

           

       

VB


 Protected Sub LoginLink_OnClick(ByVal sender As Object, ByVal e As EventArgs)
        Me.Response.Redirect(BuildLink.GetLink(ForumPages.Login, "ReturnUrl={0}", GetReturnUrl()))
    End Sub

    Protected Sub RegisterLink_OnClick(ByVal sender As Object, ByVal e As EventArgs)
        Me.Response.Redirect(BuildLink.GetLink(ForumPages.Register))
    End Sub

    Protected Function GetReturnUrl() As String
        Return HttpContext.Current.Server.UrlEncode(If(HttpContext.Current.Request.QueryString.GetFirstOrDefault("ReturnUrl").IsSet(), General.GetSafeRawUrl(HttpContext.Current.Request.QueryString.GetFirstOrDefault("ReturnUrl")), General.GetSafeRawUrl()))
    End Function

But these obviously don't work with the upgraded system. How can I make these work?

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago
here is the updated code...

Protected Sub LoginLink_OnClick(ByVal sender As Object, ByVal e As EventArgs)
       BoardContext.Current.[Get](Of LinkBuilder)().Redirect(ForumPages.Account_Login)
   End Sub

   Protected Sub RegisterLink_OnClick(ByVal sender As Object, ByVal e As EventArgs)
       BoardContext.Current.[Get](Of LinkBuilder)().Redirect(ForumPages.Account_Register)
   End Sub
eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago

here is the updated code...

Originally Posted by: tha_watcha 

It comes back and tells me that ForumPages is not declared.

eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago
And a new problem. On the message board, when you try to reply to a topic, I get the error:

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.] YAF.Controls.DisplayPost.OnPreRender(EventArgs e) +1953 System.Web.UI.Control.PreRenderRecursiveInternal() +90 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago

here is the updated code...

Originally Posted by: eutychus 

It comes back and tells me that ForumPages is not declared.

Originally Posted by: tha_watcha 

I updated the code.

eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago

here is the updated code...

Originally Posted by: tha_watcha 

It comes back and tells me that ForumPages is not declared.

Originally Posted by: eutychus 

I updated the code.

Originally Posted by: tha_watcha 

Nope. It still tells me ForumPages is not declared.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago
Does vb does not have intellisense inside vs? it should suggest that you need to add an using statement or in vb an import statment...

using YAF.Types.Constants;

Imports YAF.Types.Constants
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago

And a new problem. On the message board, when you try to reply to a topic, I get the error:

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.] YAF.Controls.DisplayPost.OnPreRender(EventArgs e) +1953 System.Web.UI.Control.PreRenderRecursiveInternal() +90 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Control.PreRenderRecursiveInternal() +163 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906

Originally Posted by: eutychus 

Issue should be fixed in latest Version 3.2.5

eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago
Okay, I think we have w winner here. My site is back up and I'm not seeing any issues with the ForumPages bug (adding Imports YAF.Types.Constants did the trick.) And updating to 3.2.5 seems to have solved the message board problem.

The only issue I can see right now is that users cannot login/out through my main page. They can do it through the message board system, so I have a workable solution there. I did notice that on the MB you have a javascript that handles the logging i/out. Is that something I should try incorporating on my main site?

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago

Okay, I think we have w winner here. My site is back up and I'm not seeing any issues with the ForumPages bug (adding Imports YAF.Types.Constants did the trick.) And updating to 3.2.5 seems to have solved the message board problem.

The only issue I can see right now is that users cannot login/out through my main page. They can do it through the message board system, so I have a workable solution there. I did notice that on the MB you have a javascript that handles the logging i/out. Is that something I should try incorporating on my main site?

Originally Posted by: eutychus 

You only need to include the forumExtensions.min.js files. Also you should not run the application in debug modus, its much slower then running it in release mode. 

Also i noticed you have not updated the bootstrap-forum.min.css for the cerulean theme you are using. This causes many ui issues.

eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago

You only need to include the forumExtensions.min.js files. Also you should not run the application in debug modus, its much slower then running it in release mode. 

Originally Posted by: tha_watcha 

That file is there, but it still steadfastly refuses to let me log out. It works fine through the message board, but not on my main page. Also, the log out is the only thing that is affected. The login works fine.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
a month ago
Sorry my mistake the logout script need to be injected via code.

I updated the sample application

https://github.com/YAFNET/YAF.SampleWebApplication/releases/tag/v3.2.5 

the script is now injected in the master page.

eutychus
  • eutychus
  • 100% (Exalted)
  • YAF Lover Topic Starter
a month ago
New issue:

I have one of my members who cannot login. I tried it on my computer, I can log in with my credentials fine, but when I try with his, using the same username and password as before the upgrade, I get:

String or binary data would be truncated.

The statement has been terminated.

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.Data.SqlClient.SqlException: String or binary data would be truncated.

The statement has been terminated.

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:

[SqlException (0x80131904): String or binary data would be truncated. The statement has been terminated.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2582954 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6034042 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +297 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4291 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +59 System.Data.SqlClient.SqlDataReader.get_MetaData() +91 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) +446 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2698 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +1611 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +65 System.Data.SqlClient.SqlCommand.ExecuteScalar() +283 ServiceStack.OrmLite.OrmLiteResultsFilterExtensions.ExecLongScalar(IDbCommand dbCmd, String sql) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteResultsFilterExtensions.cs:393 ServiceStack.OrmLite.OrmLiteWriteCommandExtensions.InsertInternal(IOrmLiteDialectProvider dialectProvider, IDbCommand dbCmd, Object obj, Action`1 commandFilter, Boolean selectIdentity) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteWriteCommandExtensions.cs:1269 ServiceStack.OrmLite.OrmLiteWriteCommandExtensions.Insert(IDbCommand dbCmd, T obj, Action`1 commandFilter, Boolean selectIdentity, Boolean enableIdentityInsert) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteWriteCommandExtensions.cs:1139 ServiceStack.OrmLite.c__DisplayClass5_0`1.b__0(IDbCommand dbCmd) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteWriteApi.cs:101 ServiceStack.OrmLite.OrmLiteExecFilter.Exec(IDbConnection dbConn, Func`2 filter) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteExecFilter.cs:180 ServiceStack.OrmLite.OrmLiteReadExpressionsApi.Exec(IDbConnection dbConn, Func`2 filter) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteReadExpressionsApi.cs:34 ServiceStack.OrmLite.OrmLiteWriteApi.Insert(IDbConnection dbConn, T obj, Boolean selectIdentity, Boolean enableIdentityInsert) in C:\YAFNET\yafsrc\ServiceStack\ServiceStack.OrmLite\OrmLiteWriteApi.cs:101 YAF.Core.Extensions.c__DisplayClass5_0`1.b__0(IDbCommand db) +72 YAF.Core.Data.DbAccessBase.Execute(Func`2 execFunc, IDbCommand cmd, IDbTransaction dbTransaction) +147 YAF.Core.Extensions.IRepositoryExtensions.Insert(IRepository`1 repository, T entity, Boolean selectIdentity) +174 YAF.Core.Services.Logger.DbLogger.Log(String message, EventLogTypes eventType, Nullable`1 userId, String source, Exception exception) +1520 YAF.Pages.Account.Login.SignIn(Object sender, EventArgs e) +992 YAF.Web.Controls.ThemeButton.OnClick(EventArgs e) +95 YAF.Web.Controls.ThemeButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +177 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9859004 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1696