Okay I’m almost about to quit this ASP.NET SHYTE.. ;(
I usually code clients and everything is very straightforward.. but this!?!
I don’t know how many problems I ahde to work my way through… Anyways I get a PARSER ERROR, SERVER TAG NOT WELL FORMED.
I have been searching the net for a couple of hour, the tips I found range from telling me too use single quotes, to retire as a programmer…
Im trying to display a group of radiobuttons, with data fetched from my database.
codebehind looks like this..
protected void fillRepeater()
{
MySqlConnection con = new MySqlConnection(@"Server=hide.my.url;Database=no_database;Uid=topsecretuser;Pwd=topsecret");
con.Open();
//ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + con.State + "');", true);
string sqlQ = "Select * from t_domains";
MySqlCommand myCommand = new MySqlCommand(sqlQ, con);
MySqlDataReader dataReader = myCommand.ExecuteReader();
Repeater1.DataSource = dataReader;
Repeater1.DataBind();
con.Close();
}
This is my HTML. I havent implemented my table rows/cells yet.. (so don’t remind me) 😉
Repeater data!<br />
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<asp:RadioButton id="RadioButton1" runat="server" GroupName="<%#DataBinder.Eval(Container.DataItem, "idtag_domain") %>" value="50" Text="Free access" onclick="calculatePrice();disableTB(this.name);" />
<br />
<asp:RadioButton id="RadioButton2" GroupName="<%#DataBinder.Eval(Container.DataItem, "idtag_domain") %>"
Text="Once a day(30/month)" value="25" onclick="calculatePrice();disableTB(this.name);" />
<br />
<asp:RadioButton id="RadioButton3" GroupName="<%#DataBinder.Eval(Container.DataItem, "idtag_domain") %>" value="0"
Text="Enter number of articles" onclick="enableTB(this.name, this.checked)" />
<br />
<asp:TextBox ID="textbox" name="<%#DataBinder.Eval(Container.DataItem, "idtag_domain") %>" Enabled="false" Width="106px"
onkeyup="calculatePrice()" style="background-color:#eeeeee" ></asp:TextBox>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
ERROR IT GIVES ME
Parser Error Message: The server tag is not well formed.
Source Error:
Line 36: <asp:RadioButton id="RadioButton1" runat="server" GroupName=" <%#DataBinder.Eval(Container.DataItem, "idtag_domain") %>" value="50" Text="Free access" onclick="calculatePrice();disableTB(this.name);" />
You should replace the ” before a <%# with a ‘ instead. This will prevent you ” in the Eval portion from improperly ending your string.