#1
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😛laceHolder runat="server" id="phCustom"></asp😛laceHolder>
<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);
        }
Topic Starter
  • vcsharp
  • Rank: YAF Commander
  • Reputation:
    Honored
    85.4%
  • Joined: 03/10/2017
  • Posts: 76
  •  Man  India
  • Thanks: 24 times
  • Was thanked: 1 time(s) in 1 post(s)
#2
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?
Topic Starter
  • vcsharp
  • Rank: YAF Commander
  • Reputation:
    Honored
    85.4%
  • Joined: 03/10/2017
  • Posts: 76
  •  Man  India
  • Thanks: 24 times
  • Was thanked: 1 time(s) in 1 post(s)
#3
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
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,002
  •  Germany
  • Thanks: 74 times
  • Was thanked: 1205 time(s) in 1031 post(s)
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

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