Welcome Guest! To enable all features please
Login or Register.
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);
}
Edited by user
2018-09-21T11:03:41Z
|
Reason: added Solved status for benefit of others
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?
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!
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.
Important Information:
The YAF.NET Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close