The authors' paper in Ref. , was the first one to provide detailed optimality conditions for pessimistic bilevel optimization. The results there were based on the concept of the two-level optimal value function introduced and analyzed in Ref. , for the case of optimistic bilevel programs. One of the basic assumptions in both of these papers is that the functions involved in the problems are at least continuously differentiable. Motivated by the fact that many real-world applications of optimization involve functions that are nondifferentiable at some points of their domain, the main goal of the current paper is extending the two-level value function approach to deriving new necessary optimality conditions for both optimistic and pessimistic versions in bilevel programming with nonsmooth data.