My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
Thursday, 26 July 2018
Tuesday, 24 July 2018
Monday, 23 July 2018
hr management system part 6 asp net How to Upload and Change Profile Pic...
public string file_upload(FileUpload fileupload)
{
string msg = "-1";
if (fileupload.HasFile)
{
string fileextenion = Path.GetExtension(fileupload.FileName);
if (fileextenion.ToLower() != ".png" && fileextenion.ToLower() != ".jpg")
{
Response.Write("<script>alert('Only images are allowed to upload , please select jpg or png image.... '); </script> ");
}
else
{
int filesize = fileupload.PostedFile.ContentLength;
if (filesize > 2097152) //cannot upload > 2 mb image......
{
Response.Write("<script>alert('Only images are allowed to upload that are size of less than 2 MB '); </script> ");
}
else
{
Random r = new Random();
int r1 = r.Next();
int r2 = r.Next();
msg = "~/Content/Uploads/" + r1 + r2 + fileupload.FileName;
fileupload.SaveAs(Server.MapPath(msg));
}
}
}
else
{
Response.Write("<script>alert('please select a file '); </script> ");
}
return msg;
}
Thursday, 19 July 2018
Wednesday, 18 July 2018
Tuesday, 17 July 2018
Subscribe to:
Posts (Atom)
Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...