best approach to create webpart? | marki | 2010-10-25 13:24 |
Status: Closed | ||
Matt's response will create a div immediately after the script block, so the div will be inside the web part. It's not really a best practice to use document.write() as it slows down page rendering, but it is OK in a pinch. I think we should do something like what Josh recommends. Note that for each *instance* of a WebPartView we already internally generate a "contentId" (see WebPartView.getContentId() ) that could be used as the value available in the substitution in <%=webPartId%> In a framed web part getContentId is assigned as the ID of the content tr. You could add something to the end of it to assign an id for an inner thing or if your part is framed you could just create a child using that id. |
||