How can I get data from input fields that are on master page?
You should probably start at this page
When the form is submitted, it should direct to a server-side page that will process the data.
Check out Read Post Data submitted to ASP.Net Form for some details on reading the data with that server side page.
MasterPage:
<asp:TextBox id="txtUsername" runat="server"></asp:TextBox>
Content Code Behind:
string username = ((TextBox)Master.FindControl("txtUsername")).Text;
I found what i was looking for. Thank you for your answers.
<% using (Html.BeginForm("LogOn", "Account", FormMethod.Post)) { %>
<%= Html.LabelFor(d => d.UserName)%>:
<%= Html.EditorFor(d => d.UserName)%>
<%= Html.LabelFor(d => d.Password)%>:
<%= Html.Password("Password")%>
<input type="submit" value="Login" />
<%= Html.ValidationSummary() %>
<% } %>
精彩评论