Query String Parser Error Message: The server tag is not well formed.

softcrew

New member
Joined
Feb 3, 2016
Messages
2
Programming Experience
5-10
Good day!

I just want a little help on my querystring structure. The value of the querystring parameter was pulled out from the database but it seems that I am missing something the way I code it. My code Below.

C#:
<ul>
<asp:Repeater ID="rptr_ResidentailFoam" runat="server">
<ItemTemplate>
   <li>[COLOR=#ff0000]<asp:HyperLink ID="" runat="server" NavigateUrl="~/products-services.aspx?type=<%# DataBinder.Eval(Container.DataItem, "QueryString_Type") %>">[/COLOR]   <%# DataBinder.Eval(Container.DataItem, "FoamType_ChildName") %></asp:HyperLink></li>
</ItemTemplate>
  </asp:Repeater>
</ul>

Something on that red font I was missing?

My Code Behind:

C#:
SqlDataAdapter mycommand = new SqlDataAdapter("Select Id, FoamType_ChildName, ChildIcon_ClassName, ParentTypeID, QueryString_Type From tbl_ProdServicesMenu_FoamProductType_Children Where ParentTypeID = " + FoamTypeID, Conn);
DataSet ds = new DataSet();
mycommand.Fill(ds);
rptr_ResidentailFoam.DataSource = ds;
rptr_ResidentailFoam.DataBind();
mycommand.Dispose();
ds.Dispose();

Thank you!
 
Oh I think I solved it. Replacing the above code(in red font color) with this html tags and ResolveUrl
C#:
<li><a href="<%# ResolveUrl("~/products-services.aspx?type=" + DataBinder.Eval(Container.DataItem, "QueryString_Type")) %>"><i class="<%# DataBinder.Eval(Container.DataItem, "ChildIcon_ClassName") %>"></i><%# DataBinder.Eval(Container.DataItem, "FoamType_ChildName") %></a></li>
 

Latest posts

Back
Top Bottom