i want to display default profile image of the user when user is created and when he upload pictures he should get profile image from database
i tried to bind image url from database using eval tag its working but its not displaying default image when new user is created
i am not using any generic handler for this i am using stored procedure for doing this
can anyone help me how to do this thanks in advance
Bhabani prasad DashPosted Jun 22, 2013, 4:36 AM
protected void Loaddata()
{
con.Open();
cmd = new SqlCommand("select gender,firstname,emailid,address,mobileno,CONVERT(VARCHAR(10),dateofbirth,111)as dateofbirth ,city,image,state from User_Information where firstname='" + Session["uid"].ToString() + "'", con);
// cmd = new SqlCommand("select * from User_Information", con);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
ddl_gender.SelectedValue = ds.Tables[0].Rows[0]["gender"].ToString();
txt_name.Text = ds.Tables[0].Rows[0]["firstname"].ToString();
txt_email.Text = ds.Tables[0].Rows[0]["emailid"].ToString();
txt_address.Text = ds.Tables[0].Rows[0]["address"].ToString();
txt_mob.Text = ds.Tables[0].Rows[0]["mobileno"].ToString();
txt_bday.Text = ds.Tables[0].Rows[0]["dateofbirth"].ToString();
txt_city.Text = ds.Tables[0].Rows[0]["city"].ToString();
img_myprofile.ImageUrl = ds.Tables[0].Rows[0]["image"].ToString().Replace("~/", "");
txt_state.Text = ds.Tables[0].Rows[0]["state"].ToString();
if (img_myprofile.ImageUrl == "")
{
img_myprofile.ImageUrl = "~/user.jpg";
}
}
Bhabani prasad DashPosted Jun 24, 2013, 6:07 AM
Bhabani prasad DashPosted Jun 24, 2013, 5:58 AM
Kavita PhardePosted Jun 24, 2013, 5:54 AM
Bhabani prasad DashPosted Jun 22, 2013, 4:38 AM
Note:user.jpg or any other default image do u want to give first added to ur projet