Bladder-innervating primary sensory neurons mediate reflex-driven bladder function under normal conditions, and contribute to debilitating bladder pain and/or overactivity in pathological states. The goal of this study was to examine the respective roles of defined subtypes of afferent neurons in bladder sensation and function in vivo via direct optogenetic activation. To accomplish this goal, we generated transgenic lines that express a Channelrhodopsin-2-eYFP fusion protein (ChR2-eYFP) in two distinct populations of sensory neurons: TRPV1-lineage neurons (Trpv1Cre;Ai32, the majority of nociceptors) and Nav1.8+ neurons (Scn10aCre;Ai32, nociceptors and some mechanosensitive fibers). In spinal cord, eYFP+ fibers in Trpv1Cre;Ai32 mice were observed predominantly in dorsal horn (DH) laminae I-II, while in Scn10aCre;Ai32 mice they extended throughout the DH, including a dense projection to lamina X. Fiber density correlated with number of retrogradely-labeled eYFP+ dorsal root ganglion neurons (82.2% Scn10aCre;Ai32 vs. 62% Trpv1Cre;Ai32) and degree of DH excitatory synaptic transmission. Photostimulation of peripheral afferent terminals significantly increased visceromotor responses to noxious bladder distension (30–50 mmHg) in both transgenic lines, and to non-noxious distension (20 mmHg) in Scn10aCre;Ai32 mice. Depolarization of ChR2+ afferents in Scn10aCre;Ai32 mice produced low- and high-amplitude bladder contractions respectively in 53% and 27% of stimulation trials, and frequency of high-amplitude contractions increased to 60% after engagement of low threshold (LT) mechanoreceptors by bladder filling. In Trpv1Cre;Ai32 mice, low-amplitude contractions occurred in 27% of trials before bladder filling, which was pre-requisite for light-evoked high-amplitude contractions (observed in 53.3% of trials). Potential explanations for these observations include physiological differences in the thresholds of stimulated fibers and their connectivity to spinal circuits.