I noticed
that using an HTMLInputRadioB utton and specifying a value to be an empty
string (""), this is overridden by ASP.Net which set the value of the
control to be the same as the ID of the control.
See the code below
* Page.aspx:
<%@ Page language="c#" Codebehind="Tes t.aspx.cs" AutoEventWireup ="false"
Inherits="Websp ace.Test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<input type="radio" runat="server" name="RadioButt ons" id="Button1"
value="1">Yes
<input type="radio" runat="server" name="RadioButt ons" id="Button2"
value=""> No
</body>
</html>
* Page.aspx.cs
using System;
using System.Text;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.H tmlControls;
namespace Webspace
{
/// <summary>
/// Asp.Net bug demonstration
/// </summary>
public class Test : System.Web.UI.P age
{
protected HtmlInputRadioB utton Button1;
protected HtmlInputRadioB utton Button2;
private void Page_Load(objec t sender, System.EventArg s e)
{
}
}
}
this generates:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<input value="1" name="RadioButt ons" id="Button1" type="radio" />Yes
<input value="Button2" name="RadioButt ons" id="Button2" type="radio" /> No
</body>
</html>
I consider this to be a bug, although it may be by design. ASP.net is
clearly overriding a value I have specified. Has anyone else experienced
this, or have any suggestions?
that using an HTMLInputRadioB utton and specifying a value to be an empty
string (""), this is overridden by ASP.Net which set the value of the
control to be the same as the ID of the control.
See the code below
* Page.aspx:
<%@ Page language="c#" Codebehind="Tes t.aspx.cs" AutoEventWireup ="false"
Inherits="Websp ace.Test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<input type="radio" runat="server" name="RadioButt ons" id="Button1"
value="1">Yes
<input type="radio" runat="server" name="RadioButt ons" id="Button2"
value=""> No
</body>
</html>
* Page.aspx.cs
using System;
using System.Text;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.H tmlControls;
namespace Webspace
{
/// <summary>
/// Asp.Net bug demonstration
/// </summary>
public class Test : System.Web.UI.P age
{
protected HtmlInputRadioB utton Button1;
protected HtmlInputRadioB utton Button2;
private void Page_Load(objec t sender, System.EventArg s e)
{
}
}
}
this generates:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<input value="1" name="RadioButt ons" id="Button1" type="radio" />Yes
<input value="Button2" name="RadioButt ons" id="Button2" type="radio" /> No
</body>
</html>
I consider this to be a bug, although it may be by design. ASP.net is
clearly overriding a value I have specified. Has anyone else experienced
this, or have any suggestions?
Comment