I am trying to create a web part that will accept data from a user and simply display it on the screen. I have researched and researched and i cannot get the data to display.
HTML
<div class="form-el-holder">
<label for="oldHostUrl" id="old-host-url-label">Old Host URL</label>
<input runat="server" type="text" id="oldHostUrl" name="oldHostUrl" />
</div>
<div class="form-el-holder">
<asp:Button runat="server" id="Button1" Text="Submit" OnClick="Submit" />
</div>
I do not have the form elements wrapped in a <form>
tag because i received an error because there can only be 1 runat="server" form.
C#
protected void Submit(object sender, EventArgs e)
{
//MesgBox("Hi"); This just lets me know if the data will display in a message box
// I have tried
Textbox obj = (Textbox)sender;
// This does not work as i get an error when trying to access the .Text method.
//I have even tried just
oldHostUrl.Text;
// I receive an error because it doesn't know what to do with the .Text method.
}
There must be a simple solution but i cannot find one. Thanks for any and all help here.