Well i 'll try , i hope the listing can be read...
public class DamageEntry : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if (Page.IsPostBack)
{
//Did some initialasation non relevent for the problem
}
else
{
//Did some initialasation non relevent for the problem
BuildDialog() ;
}
}
private void BuildDialog()
{
// Turn on the Damage Entry Table, but deactivate the subparts list.
DamageEntryTable.Visible = true;
SubpartsList.Visible = false;
//if (subpart==true) damTypes =
CarHandle.GetLocalizedDamageTypesSubpart(DBrm);
// Build rest of table.
foreach (DataRow typ in damTypes.Table.Rows)
{
// Add a new row.
TableRow r = new TableRow();
// Add a cell with the damage type description.
string damTypName = (string)typ["dt_name"];
TableCell ct = new TableCell();
ct.Text = damTypName;
ct.CssClass = "DamType";
r.Cells.Add(ct);
byte damTypID = (byte)typ["dt_id"];
foreach (DataRow sev in damSeverities.Table.Rows)
{
if(int.Parse(sev["dsev_id"].ToString()) == 0) // Don't show the blank
field here!
continue;
TableCell c = new TableCell();
c.BackColor = Color.FromArgb((byte)sev["dsev_color_r"],
(byte)sev["dsev_color_g"], (byte)sev["dsev_color_b"]);
RadioButton rb = new RadioButton();
byte damSevID = (byte)sev["dsev_id"];
//rb.ID = ConjureRadioButtonID(damTypID, (byte)sev["dsev_id"]);
rb.ID = damSevID.ToString();
if (ct.Text ==string.Empty)
{
rb.AutoPostBack = true; <**********The code
ctually reach this place. I verrified with a breakpoint***********>
rb.CheckedChanged += new EventHandler(rb_CheckedChanged);
**********************************************
}
rb.GroupName = damTypID.ToString();
c.Controls.Add(rb);
r.Cells.Add(c);
}
DamageEntryTable.Rows.Add(r);
}
// iPAQ has problems with Danish chars - I will HtmlEncode some of the
texts for now...
// Show location name - and subpart name if necessary.
DamLocLabel.Text = Server.HtmlEncode((string)activeRow["dl_name"]);
if (subpart) DamLocLabel.Text += Server.HtmlEncode(" - " +
(string)activeRowSupp["dls_name"]);
// "Other" button is only available if location has subparts (and we are
not already doing subpart dialog).
ExtendedButton.Enabled = !subpart && !activeRow.IsNull("dl_supp_group");
// The back button - disabled for now.
// BackButton.Enabled = false;
}
public void rb_CheckedChanged(object sender, System.EventArgs e)
{
string teststring = "se"; <***********This is
never called*************>
Response.Write();
}
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
bredal Jensen <br******@jensen.dk> wrote: That is correct and i just verified it...
When i select my button , it does not fire my custom event.
Well i'm obviously still missing something.
Anyway thank you for your assistance.
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too