Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は条件付きバインドをするのが好きです。たとえば、SelectedValue が null の場合、「太平洋時間」にバインドするのが好きです。以下は機能しませんが、私がやろうとしていることのアイデアを提供します
SelectedValue='<%# Bind("Zone") ?? "Pacific Time" %>'
これはまさにあなたが求めているものではないことはわかっていますが、データソースで値が NULL の場合、値を Pacific にすることはできますか?
これはうまくいくはずです
SelectedValue='<%# Bind("Zone") != null ? (string)Bind("Zone") : "Pacific Time" %>'