I’m trying to add a new seller into database but all the values i get from the input text are null
this is the form
<div class="mb-3">
<label for="SNameTb" class="form-label">Seller FirstName</label>
<input type="text" class="form-control" id="Snametb" runat="server">
</div>
And this how i’m trying to get the values
string Sname = Snametb.Value;
2
Answers
You missing the closing "/> in that input box.
So, this:
and button click code:
So, add the "/>" to your markup (maybe a cut+paste issue).
And not required, but good idea to add the value="" attribute also.
add
runat= 'server'
to the text input