Forum guidelines
AuthorQuestion
how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012
I want to send a single mail  after of multiple selection of check boxes from grid view data row.
I putted the following code :
protected void Button1_Click(object sender, EventArgs e)
{


// StringBuilder object
StringBuilder str = new StringBuilder();


// Select the checkboxes from the GridView control
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
//chkSelect.Checked = Convert.ToBoolean(Session["a"]);


if (isChecked)
{
// Column 2 is the Hoarding_ID column
str.Append(GridView1.Rows[i].Cells[0].Text);
}
}
// prints out the result
Response.Write(str.ToString());












string a = GridView1.SelectedRow.Cells[2].Text;
Session["a"] = a.ToString();


con.Open();
SqlDataAdapter da = new SqlDataAdapter("select email_id from Hoarding_buyers where username = '" + Session["b"].ToString() + "'", con);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
con.Close();


if (Session["b"] != null)
{


System.Web.Mail.MailMessage objMM = new System.Web.Mail.MailMessage();
objMM.To = dt.Rows[0][0].ToString();
objMM.From = "info@hoardingindia.co.in";


objMM.BodyFormat = System.Web.Mail.MailFormat.Text;
objMM.Priority = System.Web.Mail.MailPriority.High;
objMM.Subject = "HoardingIndia";
objMM.Body = "Dear Sir/Madam,\r\n\r\n" +
"Thank You for Contacting Us. \r\n" +
"Our Marketing Team will contact you soon.\r\n\r\n" +
"Thanks & regards \r\n" +
"Hoardingindia.co.in \r\n" +
"011-22239165, +91-8826225511 \r\n\r\n";


objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "smtp.gmail.com";
objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 465;
objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "hoardingindia2012";
objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "hoardingindia2012";
objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = true;
System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
System.Web.Mail.SmtpMail.Send(objMM);


con.Open();
SqlDataAdapter da1 = new SqlDataAdapter("select * from Hoarding_buyers where username = '" + Session["b"].ToString() + "'", con);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
DataTable dt1 = ds1.Tables[0];
con.Close();


con.Open();
SqlDataAdapter da2 = new SqlDataAdapter("select * from providers_post where h_id = '" + Session["a"].ToString() + "'", con);
DataSet ds2 = new DataSet();
da2.Fill(ds2);
DataTable dt2 = ds2.Tables[0];
con.Close();


con.Open();
SqlDataAdapter da3 = new SqlDataAdapter("select * from providers where provider_user_name in (select Provider_user_name from providers_post where h_id = '" + Session["a"].ToString() + "')", con);
DataSet ds3 = new DataSet();
da3.Fill(ds3);
DataTable dt3 = ds3.Tables[0];
con.Close();




System.Web.Mail.MailMessage objMM1 = new System.Web.Mail.MailMessage();
objMM1.To = "info@hoardingindia.co.in";
objMM1.From = "info@hoardingindia.co.in";


objMM1.BodyFormat = System.Web.Mail.MailFormat.Text;
objMM1.Priority = System.Web.Mail.MailPriority.High;
objMM1.Subject = "HoardingIndia";
objMM1.Body = "Dear Sir/Madam,\r\n\r\n" +


"We have received the details from hoarding buyer. \r\n\r\n" +


"Name :" + dt1.Rows[0][1].ToString() + "\r\n" +
"Email :" + dt1.Rows[0][10].ToString() + "\r\n" +
"Contact No.:" + dt1.Rows[0][3].ToString() + "\r\n\r\n" +


"-----------------------------------------------------------------------" + "\r\n\r\n" +


"Following are the hoarding details. \r\n\r\n" +


"Hoarding ID:" + Session["a"].ToString() + "\r\n\r\n" +
"Address :" + dt2.Rows[0][1].ToString() + "\r\n" +
"LandMark :" + dt2.Rows[0][6].ToString() + "\r\n" +
"State :" + dt2.Rows[0][4].ToString() + "\r\n" +
"District :" + dt2.Rows[0][5].ToString() + "\r\n" +
"Pin Code :" + dt2.Rows[0][8].ToString() + "\r\n" +
"Size :" + dt2.Rows[0][3].ToString() + "\r\n" +
"From Date:" + dt2.Rows[0][9].ToString() + "\r\n" +
"To Date :" + dt2.Rows[0][14].ToString() + "\r\n\r\n" +
"Hoarding Type:" + dt2.Rows[0][11].ToString() + "\r\n" +
"Lighting Type :" + dt2.Rows[0][15].ToString() + "\r\n" +
"Hoarding Cost:" + dt2.Rows[0][7].ToString() + "\r\n\r\n" +






"-----------------------------------------------------------------------" + "\r\n\r\n" +


"Following are the Hoarding owner's details in which buyer is intereated: \r\n\r\n" +


"Name :" + dt3.Rows[0][1].ToString() + "\r\n" +
"Email Id :" + dt3.Rows[0][6].ToString() + "\r\n" +
"Contact No.: " + dt3.Rows[0][2].ToString() + "\r\n\r\n\r\n";


objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "smtp.gmail.com";
objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 465;
objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "hoardingindia2012";
objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "hoardingindia2012";
objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = true;
System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
System.Web.Mail.SmtpMail.Send(objMM1);


//Response.Write("<script>alert('Thank you,we will contact you soon.')</script>");
Response.Redirect("search.aspx");
}




but the above code is throwing following error please help me:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

Line 437: { Line 438: Line 439: string a = GridView1.SelectedRow.Cells[2].ToString(); Line 440: Session["a"] = a.ToString(); Line 441:
 earlier it was sending a mail by selecting single row data but now i putted the check boxes after this its not working


AuthorReply
Re: how to send grid row data after the multiple selection
Posted By Muralidharan Deenathayalan on 28 Nov 2012  
You're getting null reference error.
So make sure,  GridView1.SelectedRow and  GridView1.SelectedRow.Cells / GridView1.SelectedRow.Cells[2] are not null.



Thanks, Murali www.codingfreaks.net
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012  
Yeah i Know that this is taking null value and i tried it but still showing same error.plaese suggest some alternates 
Re: how to send grid row data after the multiple selection
Posted By Muralidharan Deenathayalan on 28 Nov 2012  
Which one is null  (SelectedRow, Cells)?
Thanks, Murali www.codingfreaks.net
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012  
i think selectedrow is not identifying after multiple selection of check boxes because the same coding was sending mail earlier.
i have some column like select all(check boxes),view image,hoarding id.....so on
i took the hoarding id in  
             string a = GridView1.SelectedRow.Cells[2].ToString();
            Session["a"] = a.ToString();

after this i putted send mail code it was working but after putting of the checkboxes not working


Re: how to send grid row data after the multiple selection
Posted By Muralidharan Deenathayalan on 28 Nov 2012  
Don't use the selectedrow property.
Anyway you're checking the the current row is checked or not and use that row variable to get the Id.




if (isChecked)
{
string a = row.Cells[2].Text;
Session["a"] = a.ToString();
}

Hope this should work for you.

Thanks, Murali www.codingfreaks.net
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012  
Now showing the error:
Compiler Error Message: CS0103: The name 'isChecked' does not exist in the current context

Source Error:

Line 458: Line 459: Line 460:        if (isChecked) Line 461:        { Line 462:            string a = row.Cells[2].Text;

Re: how to send grid row data after the multiple selection
Posted By Muralidharan Deenathayalan on 28 Nov 2012  
You've declared row inside the for loop.

for (int i = 0; i < GridView1.Rows.Count; i++)
{
    
}

You need to change your logic a little bit. The mail sending code should be there inside your for loop. So better refactor your code. Previously you've have send only email... thats also based on the selected row. Now, you need to send the mail for all the checked rows. 


for (int i = 0; i < GridView1.Rows.Count; i++)
{
  //isschecked then send the mail otherwise just ignore the row....

  
}



Hope you would have understood the logic.


Thanks, Murali www.codingfreaks.net
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012  
yeah its working now thanks alot
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012  
as i followed your instruction its running now but when we are selecting only one check boxes, it send same id for several time(repetation) while we are selecting all checkboxes it gives correct no. of according to ID. i didnot get it yet
Re: how to send grid row data after the multiple selection
Posted By Muralidharan Deenathayalan on 28 Nov 2012  
can you post the updated code, the complete one?
Somewhere the ischecked logic is missing.

Thanks, Murali www.codingfreaks.net
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 28 Nov 2012  
As you told me am sending full code on button event

  protected void Button1_Click(object sender, EventArgs e)
    {

        // StringBuilder object
        StringBuilder str = new StringBuilder();

        // Select the checkboxes from the GridView control
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            GridViewRow row = GridView1.Rows[i];
            bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;

            if (isChecked)
            {
                // Column 2 is the Hoarding_ID column
                //str.Append(GridView1.Rows[i].Cells[2].Text);           

                string a = row.Cells[2].Text;
                Session["a"] = a.ToString();
            }



            //if (isChecked)
            //{
                //string a = row.Cells[2].Text;
                //Session["a"] = a.ToString();
            //}


        con.Open();
        SqlDataAdapter da = new SqlDataAdapter("select email_id from Hoarding_buyers where username = '" + Session["b"].ToString() + "'", con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        DataTable dt = ds.Tables[0];
        con.Close();

        if (Session["b"] != null)
        {

            System.Web.Mail.MailMessage objMM = new System.Web.Mail.MailMessage();
            objMM.To = dt.Rows[0][0].ToString();
            objMM.From = "info@hoardingindia.co.in";

            objMM.BodyFormat = System.Web.Mail.MailFormat.Text;
            objMM.Priority = System.Web.Mail.MailPriority.High;
            objMM.Subject = "HoardingIndia";
            objMM.Body = "Dear Sir/Madam,\r\n\r\n" +
                         "Thank You for Contacting Us. \r\n" +
                         "Our Marketing Team will contact you soon.\r\n\r\n" +
                         "Thanks & regards \r\n" +
                         "Hoardingindia.co.in \r\n" +
                         "011-22239165, +91-8826225511 \r\n\r\n";

            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "smtp.gmail.com";
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 465;
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "hoardingindia2012";
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "hoardingindia2012";
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = true;
            System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
            System.Web.Mail.SmtpMail.Send(objMM);

            con.Open();
            SqlDataAdapter da1 = new SqlDataAdapter("select * from Hoarding_buyers where username = '" + Session["b"].ToString() + "'", con);
            DataSet ds1 = new DataSet();
            da1.Fill(ds1);
            DataTable dt1 = ds1.Tables[0];
            con.Close();

            con.Open();
            SqlDataAdapter da2 = new SqlDataAdapter("select * from providers_post where h_id = '" + Session["a"].ToString() + "'", con);
            DataSet ds2 = new DataSet();
            da2.Fill(ds2);
            DataTable dt2 = ds2.Tables[0];
            con.Close();

            con.Open();
            SqlDataAdapter da3 = new SqlDataAdapter("select * from providers where provider_user_name in (select Provider_user_name from providers_post where h_id = '" + Session["a"].ToString() + "')", con);
            DataSet ds3 = new DataSet();
            da3.Fill(ds3);
            DataTable dt3 = ds3.Tables[0];
            con.Close();


            System.Web.Mail.MailMessage objMM1 = new System.Web.Mail.MailMessage();
            objMM1.To = "info@hoardingindia.co.in";
            objMM1.From = "info@hoardingindia.co.in";

            objMM1.BodyFormat = System.Web.Mail.MailFormat.Text;
            objMM1.Priority = System.Web.Mail.MailPriority.High;
            objMM1.Subject = "HoardingIndia";
            objMM1.Body = "Dear Sir/Madam,\r\n\r\n" +

          "We have received the details from hoarding buyer. \r\n\r\n" +

                "Name        :" + dt1.Rows[0][1].ToString() + "\r\n" +
                "Email        :" + dt1.Rows[0][10].ToString() + "\r\n" +
               "Contact No.:" + dt1.Rows[0][3].ToString() + "\r\n\r\n" +

          "-----------------------------------------------------------------------" + "\r\n\r\n" +

          "Following are the hoarding details. \r\n\r\n" +

                "Hoarding ID:" + Session["a"].ToString() + "\r\n\r\n" +
                "Address     :" + dt2.Rows[0][1].ToString() + "\r\n" +
                "LandMark :" + dt2.Rows[0][6].ToString() + "\r\n" +
                "State        :" + dt2.Rows[0][4].ToString() + "\r\n" +
                "District     :" + dt2.Rows[0][5].ToString() + "\r\n" +
                "Pin Code  :" + dt2.Rows[0][8].ToString() + "\r\n" +
                "Size         :" + dt2.Rows[0][3].ToString() + "\r\n" +
                "From Date:" + dt2.Rows[0][9].ToString() + "\r\n" +
                "To Date    :" + dt2.Rows[0][14].ToString() + "\r\n\r\n" +
               "Hoarding Type:" + dt2.Rows[0][11].ToString() + "\r\n" +
               "Lighting Type :" + dt2.Rows[0][15].ToString() + "\r\n" +
               "Hoarding Cost:" + dt2.Rows[0][7].ToString() + "\r\n\r\n" +



           "-----------------------------------------------------------------------" + "\r\n\r\n" +

           "Following are the Hoarding owner's details in which buyer is intereated: \r\n\r\n" +

                "Name         :" + dt3.Rows[0][1].ToString() + "\r\n" +
                "Email Id      :" + dt3.Rows[0][6].ToString() + "\r\n" +
              "Contact No.: " + dt3.Rows[0][2].ToString() + "\r\n\r\n\r\n";

            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "smtp.gmail.com";
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 465;
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "hoardingindia2012";
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "hoardingindia2012";
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = true;
            System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
            System.Web.Mail.SmtpMail.Send(objMM1);

            //Response.Write("<script>alert('Thank you,we will contact you soon.')</script>");
            //Response.Redirect("search.aspx");
        }
        }
        // prints out the result
        Response.Write(str.ToString());
    }

Please send me correct solutions

Re: how to send grid row data after the multiple selection
Posted By Muralidharan Deenathayalan on 29 Nov 2012   Accepted Answer


protected void Button1_Click(object sender, EventArgs e)
    {


        // StringBuilder object
        StringBuilder str = new StringBuilder();


        // Select the checkboxes from the GridView control
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            GridViewRow row = GridView1.Rows[i];
            bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;


            if (isChecked)
            {
                // Column 2 is the Hoarding_ID column
                //str.Append(GridView1.Rows[i].Cells[2].Text);          


                string a = row.Cells[2].Text;
                Session["a"] = a.ToString();
            //} removed from here






            //if (isChecked)
            //{
                //string a = row.Cells[2].Text;
                //Session["a"] = a.ToString();
            //}




        con.Open();
        SqlDataAdapter da = new SqlDataAdapter("select email_id from Hoarding_buyers where username = '" + Session["b"].ToString() + "'", con);
        DataSet ds = new DataSet();
        da.Fill(ds);
        DataTable dt = ds.Tables[0];
        con.Close();


        if (Session["b"] != null)
        {


            System.Web.Mail.MailMessage objMM = new System.Web.Mail.MailMessage();
            objMM.To = dt.Rows[0][0].ToString();
            objMM.From = "info@hoardingindia.co.in";


            objMM.BodyFormat = System.Web.Mail.MailFormat.Text;
            objMM.Priority = System.Web.Mail.MailPriority.High;
            objMM.Subject = "HoardingIndia";
            objMM.Body = "Dear Sir/Madam,\r\n\r\n" +
                         "Thank You for Contacting Us. \r\n" +
                         "Our Marketing Team will contact you soon.\r\n\r\n" +
                         "Thanks & regards \r\n" +
                         "Hoardingindia.co.in \r\n" +
                         "011-22239165, +91-8826225511 \r\n\r\n";


            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "smtp.gmail.com";
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 465;
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "hoardingindia2012";
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "hoardingindia2012";
            objMM.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = true;
            System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
            System.Web.Mail.SmtpMail.Send(objMM);


            con.Open();
            SqlDataAdapter da1 = new SqlDataAdapter("select * from Hoarding_buyers where username = '" + Session["b"].ToString() + "'", con);
            DataSet ds1 = new DataSet();
            da1.Fill(ds1);
            DataTable dt1 = ds1.Tables[0];
            con.Close();


            con.Open();
            SqlDataAdapter da2 = new SqlDataAdapter("select * from providers_post where h_id = '" + Session["a"].ToString() + "'", con);
            DataSet ds2 = new DataSet();
            da2.Fill(ds2);
            DataTable dt2 = ds2.Tables[0];
            con.Close();


            con.Open();
            SqlDataAdapter da3 = new SqlDataAdapter("select * from providers where provider_user_name in (select Provider_user_name from providers_post where h_id = '" + Session["a"].ToString() + "')", con);
            DataSet ds3 = new DataSet();
            da3.Fill(ds3);
            DataTable dt3 = ds3.Tables[0];
            con.Close();




            System.Web.Mail.MailMessage objMM1 = new System.Web.Mail.MailMessage();
            objMM1.To = "info@hoardingindia.co.in";
            objMM1.From = "info@hoardingindia.co.in";


            objMM1.BodyFormat = System.Web.Mail.MailFormat.Text;
            objMM1.Priority = System.Web.Mail.MailPriority.High;
            objMM1.Subject = "HoardingIndia";
            objMM1.Body = "Dear Sir/Madam,\r\n\r\n" +


          "We have received the details from hoarding buyer. \r\n\r\n" +


                "Name        :" + dt1.Rows[0][1].ToString() + "\r\n" +
                "Email        :" + dt1.Rows[0][10].ToString() + "\r\n" +
               "Contact No.:" + dt1.Rows[0][3].ToString() + "\r\n\r\n" +


          "-----------------------------------------------------------------------" + "\r\n\r\n" +


          "Following are the hoarding details. \r\n\r\n" +


                "Hoarding ID:" + Session["a"].ToString() + "\r\n\r\n" +
                "Address     :" + dt2.Rows[0][1].ToString() + "\r\n" +
                "LandMark :" + dt2.Rows[0][6].ToString() + "\r\n" +
                "State        :" + dt2.Rows[0][4].ToString() + "\r\n" +
                "District     :" + dt2.Rows[0][5].ToString() + "\r\n" +
                "Pin Code  :" + dt2.Rows[0][8].ToString() + "\r\n" +
                "Size         :" + dt2.Rows[0][3].ToString() + "\r\n" +
                "From Date:" + dt2.Rows[0][9].ToString() + "\r\n" +
                "To Date    :" + dt2.Rows[0][14].ToString() + "\r\n\r\n" +
               "Hoarding Type:" + dt2.Rows[0][11].ToString() + "\r\n" +
               "Lighting Type :" + dt2.Rows[0][15].ToString() + "\r\n" +
               "Hoarding Cost:" + dt2.Rows[0][7].ToString() + "\r\n\r\n" +






           "-----------------------------------------------------------------------" + "\r\n\r\n" +


           "Following are the Hoarding owner's details in which buyer is intereated: \r\n\r\n" +


                "Name         :" + dt3.Rows[0][1].ToString() + "\r\n" +
                "Email Id      :" + dt3.Rows[0][6].ToString() + "\r\n" +
              "Contact No.: " + dt3.Rows[0][2].ToString() + "\r\n\r\n\r\n";


            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "smtp.gmail.com";
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 465;
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "hoardingindia2012";
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "hoardingindia2012";
            objMM1.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = true;
            System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
            System.Web.Mail.SmtpMail.Send(objMM1);


            //Response.Write("<script>alert('Thank you,we will contact you soon.')</script>");
            //Response.Redirect("search.aspx");
        }// added here

        }
        }
        // prints out the result
        Response.Write(str.ToString());
    }


Thanks, Murali www.codingfreaks.net
Re: how to send grid row data after the multiple selection
Posted By Abhimanyu Singh on 29 Nov 2012  
Thank you sir its working well now.

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.