I'm pretty proficient in PHP, however been asked to use asp.net to design a web system.
Issue is in PHP, I know how to post values from a HTML Form and extract values from a DB. I want to do the same within asp.net however it seems the forms are processed in a different way. The following is the code I have.
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="Type" runat="server">
<asp:ListItem Selected="True">Select Template:</asp:ListItem>
<asp:ListItem Value="1">Bike Template </asp:ListItem>
<asp:ListItem Value="2">Cars Template</asp:ListItem>
</asp:DropDownList>
</div>
<p><asp:Button ID="Button1" runat="server" Text="OK" /></p>
</form>
<textarea name="'emailmessage" rows="20" cols="100"/> </textarea>
</body>
</html>
I want to pass the value of the List Item IE. 1. (Bike Template) to the DB, which will then connect run a sp and input the text from the DB in the TextArea.
I don't need to actual code for this but just guidance on how to:
a) connect to the DB. b) on click of the button to run the sp and input the value of the field in the text area. Do I use something like:
protected void Button1_Click(object sender, EventArgs e) { }?
Is there any post processing needed?