vcsharp
2018-09-21T06:55:47Z
I am trying to extend controls/yYafHeader.ascx from its code behind, but its not working.

This is what I have done.
  • Changed code-behind as well as markup in YAF source code project for the file controls/YafHeader.ascx.cs, by adding below code

  • Rebuild the source code project containing above changes

  • Copied over YAF.dll from bin folder of above YAF project to the YAF project without source code

  • Added the same custom markup to controls/YafHeader.ascx in YAF project without source code


When I run the YAF project without source code, I don't see the literal control being emitted from code-behind that I expected to be there when I copied over YAF.dll from the full source code project.

Question : Why is the customization for YafHeader.ascx not working in this situation? May be I need to add some other dll or make these changes in some other place.

Custom PlaceHolder added
<asp:PlaceHolder runat="server" id="phCustom"></asp:PlaceHolder>
<div id="yafheader">



Custom code behind added
        protected void Page_Init(object sender, EventArgs args)
        {
            LiteralControl html = new LiteralControl("<h2>Testing user control code</h2>");
            phCustom.Controls.Add(html);
        }
Sponsor
vcsharp
2018-09-21T07:17:02Z
I found out after some research, that it was an issue on my end. The YAF.dll in my project was being overwritten by old YAF.dll since the reference to it was pointing to the same file of an older version under another folder. So copying the new YAF.dll was not doing anything.

But I still have a question related to this and that is as below.
Is there any other way of extending the standard user controls under controls folder in YAF project?
2018-09-21T09:23:26Z
Originally Posted by: vcsharp 

I found out after some research, that it was an issue on my end. The YAF.dll in my project was being overwritten by old YAF.dll since the reference to it was pointing to the same file of an older version under another folder. So copying the new YAF.dll was not doing anything.

But I still have a question related to this and that is as below.
Is there any other way of extending the standard user controls under controls folder in YAF project?



No this is the only way!


UserPostedImage

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved