Example #1
0
        protected void Send_Data(object sender, EventArgs e)
        {
            EnqueryFields ef = new EnqueryFields();
            Service       my = new Service();

            Response.Write(cityList.SelectedItem.ToString());
            ef.City  = cityList.SelectedItem.ToString();
            ef.FName = FName.Text;
            ef.MName = MName.Text;
            ef.LName = LName.Text;
            ef.Email = EMAIL.Text;
            ef.Phno  = MobNo.Text;
            ef.State = stateboxList.SelectedItem.ToString();
            if (String.IsNullOrEmpty(askQue.Text))
            {
                ef.Query = null;
            }
            else
            {
                ef.Query = askQue.Text;
            }
            try
            {
                string res = my.Fill_Form(ef);
                Response.Write(res);

                string a      = res;
                string url    = "/Student/Enquery.aspx";
                string script = "window.onload = function(){ alert('";
                script += a;
                script += "');";
                script += "window.location = '";
                script += url;
                script += "'; }";
                ClientScript.RegisterStartupScript(this.GetType(), "Redirect", script, true);
            }
            catch (Exception ex)

            { Response.Write(ex); }
        }
Example #2
0
        protected void Post_Query(object sender, EventArgs e)
        {
            EnqueryFields ef = new EnqueryFields();
            Service       my = new Service();

            ef.AppID = Int32.Parse(sid);
            ef.Query = askQue.Text;
            try
            {
                string res    = my.Ask_Again_Que(ef);
                string url    = "/Student/AskQueAgain.aspx";
                string script = "window.onload = function(){ alert('";
                script += res;
                script += "');";
                script += "window.location = '";
                script += url;
                script += "'; }";
                ClientScript.RegisterStartupScript(this.GetType(), "Redirect", script, true);
            }
            catch (Exception ex)

            { Response.Write(ex); }
            // ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Query Saved Sucessfully');window.location='AskQueAgain.aspx';", true);
        }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["appid"] == null)
     {
         Response.Redirect("error.aspx");
     }
     else
     {
         String        sid = Session["appid"].ToString();
         EnqueryFields ef  = new EnqueryFields();
         Service       my  = new Service();
         ef.AppID = Int32.Parse(sid);
         try
         {
             DataTable x = my.Load_Response(ef);
             GridView2.DataSource = x;
             GridView2.DataBind();
         }
         catch (Exception ex)
         {
             Response.Write(ex);
         }
     }
 }