I'm working in a list with a custom NewForm.aspx and a custom EditForm.aspx, which I've called New.aspx and Edit.aspx. I'm far from a SharePoint expert, but it looks like the only differences between the two files are the miscellaneous ControlMode attributes set throughout the file.
ControlMode="New" for New.aspx and ControlMode="Edit" for Edit.aspx
As a test, I took the code from my New.aspx and copied it into my Edit.aspx and just changed the ControlMode attributes to 'Edit.' Everything seems to be working fine. So what I'd like to do is just use one file rather than a separate one for New and Edit. I'm not sure if this is possible, but the first step I took was to create an XSL variable:
<xsl:variable name="ControlMode" select="'Edit'" />
Then I can do something like this:
<xsl:choose>
<xsl:when test="$ControlMode = 'New'">
<SharePoint:AttachmentUpload runat="server" ControlMode="New"/>
<SharePoint:ItemHiddenVersion runat="server" ControlMode="New"/>
</xsl:when>
<xsl:when test="$ControlMode = 'Edit'">
<SharePoint:AttachmentUpload runat="server" ControlMode="Edit"/>
<SharePoint:ItemHiddenVersion runat="server" ControlMode="Edit"/>
</xsl:when>
</xsl:choose>
My form is still working fine at this point, but it's still two different files. So the question is, does anyone know a way I can populate the xsl:variable dynamically so that I can specify just one file for new and edit modes?
Thanks in advance!