Any controls that you place on the page (the .aspx) that you want to use server side need to have an ID and the attribute runat="server". You can then access on the code-behind page by using its ID.
For example, if you had a text box :
<asp:Textbox id="textBox1" runat="server" />
It could be accessed with:
textBox1.Text = "Hello World"
If a control is clickable (such as a radio button, button, etc) you also need to specify the onCLick="someMethod()" in the .aspx page and then include the same method in the code behind. For a button it would be:
<asp:Button id="button1" runat="server" text="Click me" onCLick="button1_Click" />
code behind:
sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
...
end sub
I hope that helps. The MSDN site is pretty useful when starting out (or at any other time...)
hericles
Veteran Poster
1,065 posts since Nov 2007
Reputation Points: 156
Solved Threads: 228
Skill Endorsements: 9
Question Answered as of 1 Year Ago by
hericles
and
kingsonprisonic