0

I am working on a SharePoint 2016 Project which uses SharePoint Application pages. We have a separate user control to which is used to capture address and it is used in other parts of the application.

In order to use this, I have added the user control in to the SharePoint application Page as follows.

<%@ Register TagPrefix="uc" TagName="StreetAndPostalAddress" Src="~/_controltemplates/15/Test.Features.WebParts/QAS/QASAddressStreetAndPostal.ascx" %>

And tried to use this control in the page as below.

<uc:StreetAndPostalAddress id="locationAndPostalAddress" runat="Server" />

As soon as I add this control to the page it gives me an error as below. I have tried but was unable to figure out a clue on this. Main reason was same control was working on a another page. Please share your thoughts to resolve this. Thank you.

I noticed the page used a update panel as follows

<asp:UpdatePanel ID="UP_Accordion" runat="server" UpdateMode="Conditional" ClientIDMode="Static" >

Any Idea on what is the use of it?

enter image description here

First Solution It was defined <%@ Control ClientIDMode="static" > in the page and once I change it to <%@ Control ClientIDMode="Predictable" > the issue got resolved. But the functionality of the page is not working. Because JavaScript/Jquery is not working. Which Still did not resolve my issue :(

SPKan
  • 555
  • 2
  • 12
  • 26

1 Answers1

0

Finally I figured out why the page is not working. It consists of a accordion and a Grid. And I had a requirement to repeat a same user control. Due to the ClientIDMode which was set to static I had the above error. I read this areticle to understand the concept of ClientIDMode and removed it from the page. Use below link to learn it.

1) https://weblog.west-wind.com/posts/2009/nov/07/clientidmode-in-aspnet-40

Once I removed the ClientIDMode it seems my jquery in the page is not working. I had to change the jquery selector for ID and had select using a pattern match. Once changed the page rendered correctly.

2) How to stop ASP.NET from changing IDs in order to use jQuery

SPKan
  • 555
  • 2
  • 12
  • 26