zoukankan      html  css  js  c++  java
  • WEB PART

    using System;
    using System.Runtime.InteropServices;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Serialization;

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;

    namespace WebPart200
    {
        [Guid("0cabe99e-f555-4dce-91d3-26dbff58ed54")]
        public class HQWY_Add : System.Web.UI.WebControls.WebParts.WebPart
        {
            public HQWY_Add()
            {
            }
           
            TextBox txtUid = new TextBox();
            TextBox txtUname = new TextBox();
            protected override void CreateChildControls()
            {
                base.CreateChildControls();

                System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable();
               
                System.Web.UI.HtmlControls.HtmlTableRow tablerow1 = new System.Web.UI.HtmlControls.HtmlTableRow();
                System.Web.UI.HtmlControls.HtmlTableCell tablecell = new System.Web.UI.HtmlControls.HtmlTableCell();
                Label lable1 = new Label();
                lable1.Text="输入姓名:";
                tablecell.Controls.Add(lable1);

                System.Web.UI.HtmlControls.HtmlTableCell tablecell2 = new System.Web.UI.HtmlControls.HtmlTableCell();

                tablecell2.Controls.Add(txtUid);


                tablerow1.Controls.Add(tablecell);
                tablerow1.Controls.Add(tablecell2);
                table.Controls.Add(tablerow1);


                

                  tablerow1 = new System.Web.UI.HtmlControls.HtmlTableRow();
                  tablecell = new System.Web.UI.HtmlControls.HtmlTableCell();
                  lable1 = new Label();
                lable1.Text = "输入ID:";
                tablecell.Controls.Add(lable1);

                   tablecell2 = new System.Web.UI.HtmlControls.HtmlTableCell();

                tablecell2.Controls.Add(txtUname);


                tablerow1.Controls.Add(tablecell);
                tablerow1.Controls.Add(tablecell2);
                table.Controls.Add(tablerow1);


                this.Controls.Add(table);


                Button btnadd = new Button();
                btnadd.Attributes.Add("onclick", "<script>return confirm('确定新增?')</script>");
                btnadd.Text = "新增会签文员";
                this.Load += new EventHandler(btnadd_onclick);
                this.Controls.Add(btnadd);
            }
            private void btnadd_onclick(object sender, EventArgs e)
            {
                try
                {
                    SPWeb web = SPControl.GetContextWeb(Context);
                    SPList list = web.Lists["会签文员"];
                    SPListItemCollection lists = list.Items;
                    SPListItem listitem = list.Items.Add();

                    listitem["显示名称"] = txtUname.Text;

                    listitem["登录帐号"] = txtUid.Text;

                    listitem.Update();
                }
                catch (Exception ex)
                {
                   
                }
                   

            }
        }
    }

  • 相关阅读:
    【转】ImageView的Scaletype参数设置
    android抓包工具——使用fiddler4在安卓手机抓包
    Java中JNI的使用详解第一篇:HelloWorld
    A/libc:fatal signal 11(SIGSEGV).code 1, fault addr 0x0 in tid 26488 (VideoEncoder)
    Android修改默认SharedPreferences文件的路径,SharedPreferences常用工具类
    android下asynchttp库对于session的支持
    routeros的配置资料
    Mac下关于——你不能拷贝项目“”,因为它的名称太长或包括的字符在目的宗卷上无效。文件的删除
    nginx的https配置
    ros的相关link
  • 原文地址:https://www.cnblogs.com/IsNull/p/1701037.html
Copyright © 2011-2022 走看看