using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace DataUploader { public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) { anno = DateTime.Now.Year; DOC = "OC000000"; } } protected void btnUpload_Click(object sender, EventArgs e) { caricaDoc(); } public int anno { get { int answ = DateTime.Now.Year; try { answ = Convert.ToInt32(txtAnno.Text.Trim()); } catch { } return answ; } set { txtAnno.Text = value.ToString(); } } public string DOC { get { string answ = ""; try { answ = txtDoc.Text.Trim(); } catch { } return answ; } set { txtDoc.Text = value; } } private void caricaDoc() { if (txtDoc.Text.Trim() != "") { Response.Redirect(string.Format("SyncDoc.aspx?DOC={0}&Anno={1}", DOC, anno)); } } } }