Click here to Skip to main content
15,910,661 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError:Object reference not set to an instance of an object Pin
M.Ambigai2-Feb-09 21:54
M.Ambigai2-Feb-09 21:54 
public partial class _User : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!PreviousPage.IsValid)
{
LabelName.Text = "Error";
}
else
{
TextBox textboxitem = (TextBox)PreviousPage.FindControl("TXtLoginName");
String user = textboxitem.Text;
String pswd = ((TextBox)PreviousPage.FindControl("TxtLoginPswd")).Text;
LabelName.Text = String.Format("Hai...{0}<br/>Ur password is {1}", user, pswd);
}
}
catch (Exception err)
{
LabelName.Text = "Error: " + err.Message.ToString();
}
}
}
my previous page contains textbox, TXtLoginName.Text & TxtLoginPswd
ERROR:Object reference not set to an instance of an object.
Whats the fault?
AnswerRe: Error:Object reference not set to an instance of an object Pin
Abhijit Jana2-Feb-09 22:10
professionalAbhijit Jana2-Feb-09 22:10 
AnswerRe: Error:Object reference not set to an instance of an object [modified] Pin
mr_muskurahat2-Feb-09 22:12
mr_muskurahat2-Feb-09 22:12 
GeneralRe: Error:Object reference not set to an instance of an object Pin
Abhijit Jana2-Feb-09 22:19
professionalAbhijit Jana2-Feb-09 22:19 
QuestionDifference b/n session and cache Pin
NidhiKanu2-Feb-09 21:54
professionalNidhiKanu2-Feb-09 21:54 
AnswerRe: Difference b/n session and cache Pin
anujbanka17842-Feb-09 22:01
anujbanka17842-Feb-09 22:01 
GeneralRe: Difference b/n session and cache Pin
NidhiKanu2-Feb-09 22:18
professionalNidhiKanu2-Feb-09 22:18 
AnswerRe: Difference b/n session and cache Pin
Abhijit Jana2-Feb-09 22:15
professionalAbhijit Jana2-Feb-09 22:15 
GeneralRe: Difference b/n session and cache Pin
NidhiKanu2-Feb-09 22:33
professionalNidhiKanu2-Feb-09 22:33 
GeneralRe: Difference b/n session and cache Pin
Abhijit Jana2-Feb-09 22:41
professionalAbhijit Jana2-Feb-09 22:41 
GeneralRe: Difference b/n session and cache Pin
NidhiKanu2-Feb-09 22:49
professionalNidhiKanu2-Feb-09 22:49 
GeneralRe: Difference b/n session and cache Pin
N a v a n e e t h2-Feb-09 23:38
N a v a n e e t h2-Feb-09 23:38 
QuestionProblem with gridview Pin
sarang_k2-Feb-09 21:50
sarang_k2-Feb-09 21:50 
AnswerRe: Problem with gridview Pin
anujbanka17842-Feb-09 21:58
anujbanka17842-Feb-09 21:58 
AnswerRe: Problem with gridview Pin
Anurag Gandhi2-Feb-09 22:00
professionalAnurag Gandhi2-Feb-09 22:00 
GeneralRe: Problem with gridview Pin
Abhijit Jana2-Feb-09 22:29
professionalAbhijit Jana2-Feb-09 22:29 
GeneralRe: Problem with gridview Pin
Anurag Gandhi2-Feb-09 22:55
professionalAnurag Gandhi2-Feb-09 22:55 
AnswerRe: Problem with gridview Pin
S.Dhanasekaran4-Feb-09 3:15
S.Dhanasekaran4-Feb-09 3:15 
AnswerRe: Problem with gridview Pin
RichardGrimmer5-Feb-09 4:58
RichardGrimmer5-Feb-09 4:58 
QuestionHow to pass an object as argument? [modified] Pin
Radiv Jeshya2-Feb-09 21:27
Radiv Jeshya2-Feb-09 21:27 
AnswerRe: How to pass an object as argument? Pin
Christian Graus2-Feb-09 22:35
protectorChristian Graus2-Feb-09 22:35 
QuestionRefrense to a HtmlForm Pin
mehrdadc482-Feb-09 20:46
mehrdadc482-Feb-09 20:46 
AnswerRe: Refrense to a HtmlForm Pin
Christian Graus2-Feb-09 21:03
protectorChristian Graus2-Feb-09 21:03 
GeneralRe: Refrense to a HtmlForm Pin
N a v a n e e t h2-Feb-09 21:33
N a v a n e e t h2-Feb-09 21:33 
Questionlink button in grid view is not working pls help Pin
anujbanka17842-Feb-09 20:43
anujbanka17842-Feb-09 20:43 

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

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