Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys

Below is the piec of code to check if user exist in the system

C#
if ((txtLoginID.Text == dRow["EmpEmail"].ToString()) && txtPassword.Text == dRow["EmpPassword"].ToString() && ddlvalue==cli)
            {

if ("Doctor" == dRow["EmpType"].ToString() || "Nurse" == dRow["EmpType"].ToString())
        {
Server.Transfer("~/Employee/frmEmployeeHome.aspx?EmpIDNumber=" + dRow["EmpIDNumber"].ToString());// + "&EmpFullName=" + dRow["EmpFullName"].ToString() + "&EmpIDNumber=" + dRow["EmpIDNumber"].ToString() + "&Emptype=" + dRow["Emptype"].ToString());
           found = true;
         }
           else
               if ("Admin" == dRow["EmpType"].ToString())
                    {
                                                           
             Server.Transfer("~/Administration/frmTelerikScheduling.aspx");
                                found = true;
                    }
            }

When I come to this line" Server.Transfer("~/Administration/frmTelerikScheduling.aspx");"

It goes to that page...Now below is the code from "frmTelerikScheduling.aspx"


C#
protected void Page_Load(object sender, EventArgs e)
        {
            populateddlEmployeesOnPageLoad();
            loadDDLServices();
            loadDDlPatients();
            getAppointments();

        }


So i noticed after my application read the methods it goes back to the login form

and read the code below

C#
public void loadDDlClinicName()
        {
            if (!Page.IsPostBack)
            {
                systemBusinessLayer = new BusinessLayer();

                ArrayList clinicList = new ArrayList();
                clinicList = systemBusinessLayer.getClinics();

                ddlClinicName.DataSource = clinicList;
                ddlClinicName.DataTextField = "ClinicName";
                ddlClinicName.DataValueField = "ClinicRefNumber";
                ddlClinicName.DataBind();
                ddlClinicName.Items.Insert(0, ".:Select Clinic:.");
            }
        }


Then it complains about an empty object in this line "clinicList = systemBusinessLayer.getClinics();"

method loadDDlClinicName() runs on pageload of the login page

this weird...I need help
Posted
Updated 12-Oct-11 6:37am
v2
Comments
[no name] 12-Oct-11 12:53pm    
Have you debugged anything? There is no way we can tell why your method is failing from the info you have provided.
Anele Ngqandu 12-Oct-11 13:01pm    
so what else would you like to see?
Al Moje 12-Oct-11 22:40pm    
Hi,
I think there is a PostBack.
advise you to debug and trace the error something in loadDDlClinicName().
Tejas Vaishnav 13-Oct-11 1:33am    
Try to debug and get on which line you got this error..?

1 solution

as per description u have given it is clear that postback is taking place. If u r using any authentication or authorization then that might be causing this problem.
One more thing as u r index is changing for DDLClinic it is calling the load function again so make sure u r debugging it correctly in order to find flow of the operation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900