protected void Upload_Click(object sender, EventArgs e) { try { TemplatesRepository tr = new TemplatesRepository(); string Tmpltname = TemplateName.Text; int id = tr.GetTemplateId(Tmpltname); int ChannelId = Convert.ToInt32(ChannelDDL.SelectedValue); string url = URL.Text; int ApprovalStatus = 1; tr.InsertUrl(id, ChannelId, url, ApprovalStatus); Uploadsucces.Text = "Template Inserted"; } catch (Exception ex) { uploadlbltxt.Text = "First Create the template,then upload your template url!!"; } }