public JsonResult submitQuestion(tblQuestion question)
        {

            if(!question.questionImage.Contains("undefined") && question.questionImage != null)
            {
                var regex = new Regex(@"data:(?<mime>[\w/\-\.]+);(?<encoding>\w+),(?<data>.*),(?<height>[0-9]+)px,(?<width>[0-9]+)px", RegexOptions.Compiled);
                var match = regex.Match(question.questionImage);

                var mime = match.Groups["mime"].Value;
                var encoding = match.Groups["encoding"].Value;
                string data = match.Groups["data"].Value;
                var height = Convert.ToInt32(match.Groups["height"].Value);
                var width = Convert.ToInt32(match.Groups["width"].Value);


                Image img = SuccessVidya.BAL.Utility.Base64ToImage(data);
                Image resizedImage = img.GetThumbnailImage(width, height, null, IntPtr.Zero);

                question.questionImage = Guid.NewGuid().ToString();
                //resizedImage.Save("~/QuestionImages/asd1.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
                resizedImage.Save(Server.MapPath("~/QuestionImages/" + question.questionImage + ".jpeg"), System.Drawing.Imaging.ImageFormat.Jpeg);               

                int index = question.questionText.IndexOf(data); 
                //without image will go to DB
                question.questionText = (index < 0)
                    ? question.questionText
                    : question.questionText.Remove(index, data.Length);
            }

            question.createOn = DateTime.Now;
            question.Years = 2013;
            question.userID = 2;
            question.secionID = 11;
            question.Examid = 1;
            question.correctAnswer = "A";



            using (SVDB_Entities db = new SVDB_Entities())
            {
                if (ModelState.IsValid)
                {
                    db.tblQuestions.Add(question);
                    db.SaveChanges();
                }
            }
            return Json(new { Answer = "question submitted", ErrorMessage = "" });
            //return RedirectToAction("Index","Home");
        }
 public ActionResult index(tblQuestion _questionEntity)
 {
     return View();
 }