Adesso forse ho capito cosa vuoi fare.
Ecco qui un piccolo esempio:
Codice PHP:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Forum._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:PlaceHolder ID="placeholder1" runat="server">
</asp:PlaceHolder>
<asp:Button ID="btn1" runat="server" onclick="btn1_Click" Text="Invia" />
</div>
</form>
</body>
</html>
Codice PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Forum {
public partial class _Default : System.Web.UI.Page
{
RadioButtonList pippo = new RadioButtonList();
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
ListItem li = new ListItem(i.ToString(), i.ToString());
pippo.Items.Add(li);
}
placeholder1.Controls.Add(pippo);
}
protected void btn1_Click(object sender, EventArgs e)
{
ListItem li = pippo.SelectedItem as ListItem;
if (li != null)
{
Response.Write(string.Format("{0} - {1}", li.Text, li.Value));
}
}
}
}
Ti consiglio un buon libro di asp.net.
Tra Asp e Asp.Net l'unica cosa in comune sono le iniziali del nome.
Sono due tecnologie completamente differenti.
In bocca al lupo