Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        InitializeEvents();
        readQueryString();

        string description    = "";
        string attachmentType = "";

        setupMultipleFileGrid();
        btnSubmit.Click += this.btnSubmit_Click;

        if (!IsPostBack)
        {
            //If we are adding a newsAttachment then we want dont want the user to be able to change it
            if (Module != "News")
            {
                DataTable dtAttachmentType = WTSData.AttachmentType_GetList();

                ddlAttachmentType.DataSource     = dtAttachmentType;
                ddlAttachmentType.DataValueField = "ATTACHMENTTYPEID";
                ddlAttachmentType.DataTextField  = "ATTACHMENTTYPE";
                ddlAttachmentType.DataBind();

                ListItem item = new ListItem("- Select -", "0");
                ddlAttachmentType.Items.Insert(0, item);

                if (Request.QueryString["attachmentType"] != null)
                {
                    attachmentType = Server.UrlDecode(Request.QueryString["attachmentType"]);
                }

                item = ddlAttachmentType.Items.FindByText(attachmentType);
                if (item != null)
                {
                    item.Selected = true;
                }
            }

            if (Request.QueryString["description"] != null)
            {
                description = Server.UrlDecode(Request.QueryString["description"]);
            }
            txtDescription.Text  = description;
            txtAttachmentID.Text = this.AttachmentID.ToString();
        }
    }