Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

There is a webpart.

aspx:

<input type="text" id="textField"/>
<input type="text" id="textField2"/>
<input type="button" id="sendButton">

How can i send all input values to server? I am used to write <form>, but there is no ability to use it.

share|improve this question
1  
You need to get started with ASP.NET development. This is not even SharePoint related question... – Arko D Aug 1 '12 at 12:25

closed as off topic by PirateEric, John Chapman, Ryan, Per Jakobsen, Falak Mahmood Nov 23 '12 at 15:33

Questions on SharePoint Stack Exchange are expected to relate to SharePoint within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

One way to do it is to have a button in your webpart:

<asp:button id="myButton" Text="Click Me" runat="server" />

The inputs need to have the 'runat' added

<input type="text" id="textField" runat="server"/>

Then, in your code behind:

private void myButton_Click(object sender, EventArgs e)
    {
         string myInput = textField.Value;
         textField2.InnerText = myInput + " was entered";
    }
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.