Question

Here is my the code for my gridview

<asp:GridView ID="gvPredstave" runat="server" CssClass="gridview" AlternatingRowStyle-CssClass="even" AutoGenerateColumns="True">
        <Columns>
    <asp:TemplateField>
        <ItemTemplate>
            <asp:Button ID="btnGetInfo" runat="server"Text="GetInfo" />
        </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>

When i start my app and try to open this page I am getting an error in line where is button defined with message:

The server tag is not well formed

Does anybody know the problem?

P.S. I am using Visual Studio 2010

No correct solution

OTHER TIPS

This might be is (I just verified it) your problem:

 runat="server"Text="GetInfo"

Try changing it to:

runat="server" Text="GetInfo"

Add a space after "server" in <asp:Button line:

<asp:Button ID="btnGetInfo" runat="server" Text="GetInfo" />

You may need set the CommandArgument and CommandName properties:

<asp:Button ID="btnGetInfo" runat="server" Text="GetInfo" CommandArgument='<%# Eval("Primary_field") %>' CommandName='GetInfo' />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top