Thursday, November 28, 2013

Add GridView Row Without PostBack And Get value using Jquery AutoComplete

  
    
    
    
    
    
Add Html Code
  

    
AutoComplete Demo With Editable Html Grid
Yor Product Name :
       
  
 [System.Web.Services.WebMethod]
        public static string CalledPageMethod(string jsonString, string total)
        {
            JsonSerializer json = new JsonSerializer();

            List sdf = JsonConvert.DeserializeObject>(jsonString);
            string subTotal = total;
            return "success";
        }

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public static List GetAllProduct()
        {
            List product = null;

            using (ManishTempEntities obj = new ManishTempEntities())
            {
                product = obj.Products
                    .OrderBy(p => p.Category.Name)
                    .Select(p => new Entity.Product
                    {
                        Id = p.Id,
                        CatId = p.CatId,
                        Name = p.Name,
                        CategoryName = p.Category.Name,
                    }).ToList();
            }

            return product;
        }

        internal class MyClass
        {
            public Guid Id { get; set; }

            public string Name { get; set; }

            private int _Qnty;

            public int Qnty
            {
                get { return _Qnty = 1; }
                set { _Qnty = value; }
            }

            public decimal Price { get; set; }

            public decimal Total { get; set; }
        }

Tuesday, November 12, 2013

Open and Save As Dialog Boxes / Propmt Dialog Box

Here i have posted code for download and open dialog code using Asp.net with C#.
if u have already created file or open file using this code, and client can save and download file
using this.
  
 Response.Clear();
 Response.ContentType = "application/pdf";
 Response.AppendHeader("Content-Disposition", "attachment; filename=yourfilename.pdf");
 Response.TransmitFile(Server.MapPath("~/DirectoryName/yourfilename.pdf"));
Hey gusys, here you can add ContentType as per your file format. Note:Don't use blank space between your file name.