| Newbie | | Join Date: Oct 2008
Posts: 7
| |
Hi,
Im working on migration of one proj from .Net1.1 to2.0 in that some pages are unble to run;
on Debug i havent obeserved ani error at any line but in IE .getting this error ServerError:Object reference not set to an instance of an object. - using System;
-
using System.Data;
-
using System.Configuration;
-
using System.Collections;
-
using System.Web;
-
using System.Web.Security;
-
using System.Web.UI;
-
using System.Web.UI.WebControls;
-
using System.Web.UI.WebControls.WebParts;
-
using System.Web.UI.HtmlControls;
-
-
/// <summary>
-
/// Summary description for DCA_Reassign.
-
/// </summary>
-
public partial class Presentation_DCAdmin_DCA_Reassign : System.Web.UI.Page
-
{
-
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
Response.Cache.SetCacheability(HttpCacheability.NoCache);
-
CommonUI.CheckUser();
-
CommonUI.FillHeader(litHeader, "Diagnostic Center Admin");
-
btnView.Attributes.Add("onclick", "return validate();");
-
Session["pid"] = "1";
-
if (!IsPostBack)
-
{
-
Session["pid"] = "1";
-
DC_Admin objDCAdmin = new DC_Admin(Session["UserId"].ToString());
-
objDCAdmin.InsertUsageCount("P", Convert.ToInt32(Session["pid"].ToString()));
-
tblNoData.Visible = false;
-
tblDetails.Visible = false;
-
FillCountryList();
-
Response.Write("I am wrkin");
-
// ddlLocation.Items.Insert(0, new ListItem("--Select--", "0"));
-
// ddlDiagnosticCenter.Items.Insert(0, new ListItem("--Select--", "0"));
-
}
-
// Put user code to initialize the page here
-
-
}
-
-
private void FillCountryList()
-
{
-
try
-
{
-
DC_Admin objDCAdmin = new DC_Admin(Session["UserId"].ToString());
-
DataSet dsDetails = objDCAdmin.DC_GetCountryNames();
-
CommonUI.FillDropdown(ddlCountry, dsDetails.Tables[0], "COUNTRY_NAME", "COUNTRY_CODE", "--Select--", "--Select--");
-
objDCAdmin = null;
-
}
-
catch
-
{
-
}
-
}
-
-
#region Web Form Designer generated code
-
override protected void OnInit(EventArgs e)
-
{
-
//
-
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
-
//
-
if (Session["UserID"] == null)
-
{
-
Session["UserID"] = "0";
-
}
-
InitializeComponent();
-
base.OnInit(e);
-
CommonUI.LoadDefaults(BodyID, litHeader, Session["UserID"].ToString());
-
}
-
-
/// <summary>
-
/// Required method for Designer support - do not modify
-
/// the contents of this method with the code editor.
-
/// </summary>
-
private void InitializeComponent()
-
{
-
this.grdDetails.ItemCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.grdDetails_ItemCommand);
-
-
}
-
#endregion
-
-
-
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
-
{
-
string CountryCode = Convert.ToString(ddlCountry.SelectedValue);
-
try
-
{
-
DC_Admin objDCAdmin = new DC_Admin(Session["UserId"].ToString());
-
DataSet dsDetails = objDCAdmin.DC_GetCityNames(CountryCode);
-
CommonUI.FillDropdown(ddlLocation, dsDetails.Tables[0], "CCM_CITY_DESC", "CCM_NEW_CTY_CODE", "--Select--", "--Select--");
-
}
-
catch
-
{ }
-
ddlDiagnosticCenter.Items.Clear();
-
ddlDiagnosticCenter.Items.Insert(0, new ListItem("--Select--", "-1"));
-
ddlDiagnosticCenter.ClearSelection();
-
ddlDiagnosticCenter.Items[0].Selected = true;
-
}
-
protected void ddlLocation_SelectedIndexChanged(object sender, EventArgs e)
-
{
-
string CityCode = Convert.ToString(ddlLocation.SelectedValue);
-
try
-
{
-
DC_Admin objDCAdmin = new DC_Admin(Session["UserId"].ToString());
-
DataSet dsDetails = objDCAdmin.DC_GetDCName(CityCode);
-
CommonUI.FillDropdown(ddlDiagnosticCenter, dsDetails.Tables[0], "DC_VENDOR_NAME", "DC_VENDOR_ID", "--Select--", "--Select--");
-
}
-
catch
-
{ }
-
ddlDiagnosticCenter.ClearSelection();
-
ddlDiagnosticCenter.Items[0].Selected = true;
-
}
-
protected void btnView_Click(object sender, EventArgs e)
-
{
-
CommonUI.CheckUser();
-
int CandidateId = -1;
-
if (txtCandId.Text.Trim() != "")
-
CandidateId = Convert.ToInt32(txtCandId.Text);
-
string CandidateName = "-1";
-
if (txtCandName.Text.Trim() != "")
-
CandidateName = txtCandName.Text.Trim();
-
string Country = Convert.ToString(ddlCountry.SelectedValue.Trim().ToString());
-
string Location = Convert.ToString(ddlLocation.SelectedValue.Trim().ToString());
-
string DCId = ddlDiagnosticCenter.SelectedValue.Trim().ToString();
-
-
try
-
{
-
DC_Admin objDCAdmin = new DC_Admin(Session["UserId"].ToString());
-
DataSet dsDetails = objDCAdmin.DC_Getcandidate_Deatails(CandidateId, CandidateName, Country, Location, DCId, 2);
-
if (dsDetails.Tables[0].Rows.Count > 0)
-
{
-
tblNoData.Visible = false;
-
tblDetails.Visible = true;
-
grdDetails.DataSource = dsDetails;
-
grdDetails.DataBind();
-
}
-
else
-
{
-
tblNoData.Visible = true;
-
tblDetails.Visible = false;
-
}
-
}
-
catch
-
{ }
-
-
}
-
-
protected void grdDetails_ItemCommand(object source, DataGridCommandEventArgs e)
-
{
-
if (e.CommandName.ToString() == "Reassign")
-
{
-
int CandidateId = Convert.ToInt32(e.Item.Cells[0].Text.ToString());
-
Response.Redirect("ReassignCandidate.aspx?CandidateId=" + CandidateId);
-
}
-
}
-
}
pls suggest a solution for this
thanks®ards
Swathi
|