Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

RE: Re: 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'.

$
0
0

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'.


I am getting this when I run the code.

<asp:GridView ID="GV_GeneralForums" runat="server" AutoGenerateColumns="False" BorderColor="White"
BorderStyle="None" ShowHeader="False" Width="890px" AllowPaging="True" OnPageIndexChanging="GV_News_PageIndexChanging"
OnSelectedIndexChanging="bt" AutoGenerateSelectButton="true">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Visible="true" Text='<%# Eval("ID")%>'></asp:Label>

in code behind:

int _ID = Int32.Parse(((TextBox)(row.Cells[1].Controls[0])).Text);

what to do?



Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>