Each time you click on the button, determine whether the page has the line, there is no popup repeater line, and give him a line attached to the value, no jump

Source: Internet
Author: User

protected void btnAdd_Click (object sender, EventArgs e)
{

Try
{

Record the number of times to append
presscount++;
Typestring.add (TypeSelect.SelectedItem.ToString ());
if (Typestring.count > 1)
{
for (int i = 0; i < typestring.count-1; i++)
{
if (Typestring[typestring.count-1]. Equals (Typestring[i]))
{
String laststring = Typestring[typestring.count-1];
Typestring.remove (laststring);
presscount--;
Return
}
}
}
M_con = Dataaccess.dbconn ();

if (session["Sellersave"]. ToString (). Trim (). Equals ("1"))
{
Whether to choose species
if (typeSelect.SelectedValue.ToString (). Equals ("0"))
{
Tips for choosing a species
Errorhelp.alertmessageinajax (page, "S0100002");
}
Else
{
DataTable tab_inforesinfo = new DataTable ();
TAB_INFORESINFO.COLUMNS.ADD ("type", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Responsiblecd", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Update_username", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Update_date", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("ZipCode", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Prefectures", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("City", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Detail1", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Detail2", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("email", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("department", typeof (String));
Tab_InfoResInfo.Columns.Add ("title", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("name", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Tel", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("mobile", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Fax", typeof (String));
TAB_INFORESINFO.COLUMNS.ADD ("Note", typeof (String));
for (int i = 0; i < Presscount; i++)
{

Adding rows
DataRow dr = Tab_inforesinfo.newrow ();
TAB_INFORESINFO.ROWS.ADD (DR);
}
Go heavy
Distinct (typestring);
The list is converted into data
string[] Typearray = Typestring.toarray ();
for (int i = 0; i < typearray.length; i++)
{
Tab_inforesinfo.rows[i][0] = Typearray[i];
}
Tab_inforesinfo.rows[presscount-1][0] = session["repeater_type_string"]. ToString (). Trim ();
Sellersindex_repeater.datasource = Tab_inforesinfo;
Sellersindex_repeater.databind ();
for (int i = 0; i < This.sellersIndex_Repeater.Items.Count; i++)
{
RepeaterItem Resitem = sellersindex_repeater.items[i];
TextBox Repeater_responsiblecdtextbox = (textbox) Resitem.findcontrol ("Repeater_responsiblecd");
Repeater_responsiblecdtextbox.readonly = true;
repeater_responsiblecdtextbox.enabled = false;

}
RESSAVE.STYLE.ADD ("Display", "block");
RESSAVE.STYLE.ADD ("Display", "block");


}
}
Else
{
Please save Sellers Ó first
Errorhelp.alertmessageinajax (page, "S0100038");
}


}
catch (Mysqlexception ex)
{
Lbl_error. Text = ex. ToString ();
Logcontrol.cmnoutputlog (Const.PageCodes.ProCategoryManage, Const.ErrorLevel.ERROR, ex. ToString ());
}
catch (Exception ex)
{
Lbl_error. Text = ex. ToString ();
Logcontrol.cmnoutputlog (Const.PageCodes.ProCategoryManage, Const.ErrorLevel.ERROR, ex. ToString ());

}
Finally
{
Dataaccess.dbclose (M_con);
}

}

Each time you click on the button, determine whether the page has the line, there is no popup repeater line, and give him a line attached to the value, no jump

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.