» Home » NullReferenceException » Page 1
ASP.NET NullReferenceException
Category : Coding

I am trying to write the user login details to the Database.
When I click the submit button Im getting a NullReferenceException.
There are 4 TextBoxes
Username, Email, Password and ConfirmPassword.


protected void Button1_Click(object sender, EventArgs e)
{
if ((RegisterUserWizardStep.FindControl("Password") as TextBox).Text == (Registe

View Replies


Need help with NullReferenceException
Category : Programming Languages
DateTime mydt = new DateTime();
mydt = Convert.ToDateTime(com.Decrypt(Request.QueryString["Time"].ToString(), com.KeyCode.ToString()));

What am I doing wrong ? Its giving NullReferenceException.


View Replies


NullReferenceException in XNA with C#
Category : C & C++ & C#

I am trying to make a simple 3D game for windows with XNA and C#. I was trying to create view Matrices, as is suggested by every tutorial, and even MSDN, but I am getting a NullReferenceException error.


The error reads: Object Reference not set to an instance of an Object.
It points to the definition of the projection matrix:


projectionMatrix = Matrix.CreatePersp

View Replies


Getting a NullReferenceException
Category : Programming Languages

I'm getting this:


private object setReportValues(object report, FormCollection values)
{
PropertyInfo[] properties = report.GetType().GetProperties();
foreach (PropertyInfo property in properties)
{
string val = values.GetValue(property.Name).ToString();
property.SetValue(report, val, null);
View Replies


NullReferenceException on IIS/ASP.net - out of nowhere?
Category : Programming Languages

I'm currently working on a website for a software company. I have a mechanism that runs as soon as the page loads (in Page_OnLoad, Masterpage code file), creates a new instance of an own class and runs a function from there.
Everything was running fine for weeks, and I worked on the website at completely different pages/areas that do not affect my current cause in any way.


So t


View Replies


I get NullReferenceException
Category : Programming Languages

i get NullReferenceException when fill Repeater.Some products features empty.i used IsNullControl() method when use UrlDecode() and kill() method for avoid exception.But i get error still.


<asp:Repeater ID="rptProducts" runat="server">
<ItemTemplate>
<div>
<%# Eval("ProductName")%>

View Replies


Possible NullreferenceException
Category : Programming Languages

Resharper is showing a "Possible System.NullReferenceException" warning. I however can't see how I can get one.


public class PlaceController : PlanningControllerBase
{
[Authorize]
public ActionResult StartStop(int id)
{
if (Request != null && Request.Cookies != null && Request.Cookies["place"] != null)
{
View Replies


Avoiding a NullReferenceException
Category : Programming Languages

I have used this code for extracting urls from web page.But in the line of 'foreach' it is showing


Object reference not set to an instance of an object


exception. What is the problem? how can i correct that?


WebClient client = new WebClient();
string url = "http://www.google.co.in/search?hl=en&q=java&start=10&sa=N";
string source

View Replies


ReSharper help: Possible NullReferenceException
Category : Programming Languages

ReSharper says "Check if 'UserHostAddress' is not null" when I'm accessing HttpContext.Current.Request.UserHostAddress (it is in a try/catch block).


Within another method get the following property from the request object:


HttpContext.Current.Request.RawUrl


How does ReSharper determine or "know" that Request cannot be null

View Replies


NullReferenceException in EntityFramework, how come?
Category : Programming Languages

Take a look at this query:


var user = GetUser(userId);
var sessionInvites = ctx.SessionInvites
.Include("InvitingUser")
.Include("InvitedUser")
.Where(e => e.InvitedUser.UserId == user.UserId)
.ToList();
var invites = sessionInvites;
// Commenting out the two lines below, and it works as expected.
foreach (var invite in s

View Replies


Next
2012 / 2017 Copyrights BigHow , All Rights Reserved .