Click here to Skip to main content
       

ASP.NET

 
QuestionWoW Slider now showing the image PinmemberJassim Rahma5-Jan-13 8:06 
AnswerRe: WoW Slider now showing the image PinmvpSandeep Mewara5-Jan-13 20:09 
QuestionUnable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pinmemberamsedky5-Jan-13 1:00 
AnswerRe: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox PinmvpSandeep Mewara5-Jan-13 20:24 
amsedky wrote:
Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox
//((TextBox)PayGridView.Rows[e.RowIndex].Cells[3].Controls[0]).Text;

Error in itself is quite straight forward.
 
You are directly casting controls from Grid cells into a defined type. One of the conversion is not correct. There is a Literal control instead of a textbox. A simple use of Visual Studio debugger will tell the line of code. Once you know, just handle it properly.
Sandeep Mewara
Microsoft ASP.NET MVP 2012 & 2013
 

[My Latest Article(s)]:
How to extend a WPF Textbox to Custom Picker
Server side Delimiters in ASP.NET

Questiondisplay animated image while save data to asp.net Pinmemberashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net PinmvpSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net PinmemberManjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net PinmemberRahul Rajat Singh4-Jan-13 1:04 
QuestionInsert/Update/Delete Records in Dynamic Generated Textbox/Checkbox and Loop Through All Records Pinmemberguodl3-Jan-13 10:11 
Questionlive update PinmemberSubin Mavunkal3-Jan-13 2:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 23 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid