web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Nishant Rana’s Weblog / Using clientidmode property...

Using clientidmode property to get the id of the control in JavaScript in Visual Web Part

Nishant Rana Profile Picture Nishant Rana 11,325 Microsoft Employee

Hi,

In a Visual Web Part we were saving few values in a hidden input field and were retrieving it in the jScript. However the issue we were facing was the id of the control kept changing.

http://therightstuff.de/2006/02/14/Accessing-Controls-In-SharePoint-Web-Parts-Using-JavaScript-On-The-Client-Side.aspx

Here the clientidmode property came to rescue.

<input id=”hiddenobject” type=”hidden” clientidmode=”Static” runat=”server”/>

With the clientidmode set as static the id remains the same.

Hope it helps.


Filed under: SharePoint, SharePoint 2013 Tagged: SharePoint, SharePoint 2013

This was originally posted here.

Comments

*This post is locked for comments