Reputation: 547
I am a starter for asp .net. On my webpage, there are a few textboxes and a submit botton. Is there a easy way to get access the data and use it to built an object ? The textboxes has there names and ids, there should be a way to get access them by names and ids.
Upvotes: 0
Views: 723
Reputation: 176886
Edit
this is normal html control
<input type="text" class="text-box" id=xxx />
if you want to access it in your codebehind file you need to add runat=server
attribute to this
<asp:textbox>
Other one is server side control asp.net control not html control
I think its better you read out basic of asp.net before stating programming because this is very basic question you should know about
prev
step 1: make use of asp.net Textbox
<asp:Textbox id="textbox1" runat="server"></asp:Textbox>
Step 2: for asp.net you just need to write in you codebehind file
object.proertyname = texboxid.Text;
Read more : TextBox Class
Upvotes: 1