I am using Microsoft Visual Web developer 2010. I have Google Maps embedded on my webpage and a textbox (txtBoxInput) using the code:
<input runat="server" type="text" id="txtBoxInput"/>
A button which displays a new map loction:
<input type="button" id="btnDisplay" value="Display map" style="height:34px;width:90px;" onclick="showPoint();"/>
I also have an aspn.net button (btnTest) using the code:
<asp:Button ID="btnTest" runat="server" onclick="Button1_Click" Text="Button"/>
And the code in btnTest's event:
protected void Button1_Click(object sender, EventArgs e)
{
string test = txtBoxInput.Value = "New York, United States";
}
When I click the button (btnTest), the textbox (txtBoxInput) gets filled with "New York, United States". I then click btnDisplay but nothing happens.
When I remove runat="server" from txtBoxInput, it works. When it is removed txtBoxInput isnt recognised in the asp.net btnTest event.
Is there a way to fix this? The cause must be because of the line: <input runat="server" type="text" id="txtBoxInput"/>