CH_3CN is a species observed to be much more abundant in ultracompact hot molecular cores (UCHCs) than can be accounted for by dark cloud gas phase chemistry. The close proximity of UCHCs to newly formed OB stars suggests that an impinging far ultraviolet (FUV) radiation field might contribute to the chemical processing at the core margins. In this paper, the photochemistry of gas phase CH_3CN formation is explored assuming an enhanced FUV radiation field interacts with dense neutral material evaporated from grain mantle ices. We are able to show that high CH_3CN/CH_3OH abundance ratios can be generated from CH_3OH and NH_3 precursors in such a photon-dominated margin as a realistic alternative to a grain surface origin. We show that the observed CH_3CN/CH_3OH column density ratio towards the UCHC in G34.3+0.15 can be interpreted as arising from photochemical generation of CH_3CN in the gas phase.