we are migrating from Tridion 2011 to SDL web 8.5 and we found that a simple LinkButton is not causing the postback (we are using C#).

A note here is, we have other pages with postback working, but the difference is, the postback code is into the page, instead of Component Template.

The Component Template is "ASCX web Control" and it is published as a dynamic Component.

If I open the ascx generated in the filesystem, I see the code of this button:

<% if (rootNav == "home") { %>  
    <asp:LinkButton ID="lnkCompare" runat="server" Text="" OnClick="lnkCompare_Click" class="button first blue"><%=Resources.shared.compare_text%></asp:LinkButton>   

Browser dev tool aspx source code:

<a id="lnkCompare" class="button first blue" href="javascript:__doPostBack('lnkCompare','')">Compare</a>

When I compare this code with our current site (where this code is working), I see the control ID wasn't changed.

Here is the source code of our current site

<a id="MainContent_ctl00_ctl00_lnkCompare" class="button first blue" href="javascript:__doPostBack('ctl00$MainContent$ctl00$ctl00$lnkCompare','')">Compare</a>

I've done a simple test, copying all the code from the ascx control and paste into the aspx, in that case the button worked very well.

Any ideas where I can take a look?

  • Is there any javascript running that may be interacting with "lnkCompare"? Are there more than one lnkCompare items on the page? and is anything showing in the debug window? Commented Oct 13, 2017 at 9:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.