c# - Dropdown value coming blank but still going in IF condition -
while submitting form, not selecting value dropdownlist , checking condition as
if (request.form["cmbnextuser"] != session["userid"].tostring() || request.form["cmbnextuser"] != null || request.form["cmbnextuser"] != "") { transfermail(); }
so, while debugging value comes below.
the value coming blank still going in if condition
condition 1 causing since comparing value
request.form["cmbnextuser"] != session["userid"].tostring()
i.e
"" != session["userid"].tostring()
evaluated ture thats why it executing if block.change code this
if (!string.isnullorempty(request.form["cmbnextuser"]) || request.form["cmbnextuser"] != session["userid"].tostring() ) { transfermail(); }
Comments
Post a Comment