Capacity formulas and random-coding and sphere-packing exponents are derived for a generalized family of Gel'fand-Pinsker coding problems. Information is to be reliably transmitted through a noisy channel with random state sequence. Partial information about the state sequence is available to the encoder and decoder. Two families of channels are considered: 1) compound discrete memoryless channels (C-DMC), and 2) channels with arbitrary memory, subject to an additive cost constraint, or more generally to a constraint on the conditional type of the channel output given the input. Both problems are closely connected. For the C-DMC case, our random-coding and sphere-packing exponents coincide at high rates, thereby determining the reliability function of the channel family. The random-coding exponent is achieved using a 3-D binning scheme and a maximum penalized mutual information decoder. In the case of arbitrary channels with memory, a larger random-coding error exponent than in the C-DMC case is obtained. Applications of this study include watermarking, data hiding, communication in presence of partially known interferers, and problems such as broadcast channels, all of which involve the fundamental idea of binning.