So i'm trying to adjust a small piece of code (i'm not known with C# ASP.NET Razor) to where i can compare an user value input to my own string like so:
<input id="test" name="test" type="text" value="hello" required>
string strTest = Library.StripHtml(Request["test"]).ToString();
if(string.IsNullOrEmpty(strTest)){
client.Send(mail);
}
to something like
if(test.input == "hello"){
client.Send(mail);
}
The idea behind it is to make the field required so that if the value is changed the mail wont send (honeypot method). I guess most bots simply don't fill the forms without an requirement.
Your question lacks some information or code. The input has an id test but the condition is using strTest so there is some other code involved in parsing the input.
Assuming that you can still use the strTest variable in your new condition, why not simply check that variable against your predefined string?
if(strTest == "hello"){
client.Send(mail);
}