protected void OnClick_Download(object sender, EventArgs e) { DataTable dt = new DataTable(); userVo = (UserVo)Session["userVo"]; if (txtFromDate.Text == "" || txtToDate.Text == "") { errDateNull.Visible = true; errDateNull.Text = "'From Date' or 'To Date' cannot be null"; } else { if (ddlAssetGroup.SelectedValue == Contants.Source.Equity.ToString() && ddlSource.SelectedValue == Contants.NSE) { dt = objDownload.downloadNSEEquityData(userVo.UserId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text)); } if (ddlAssetGroup.SelectedValue == Contants.Source.Equity.ToString() && ddlSource.SelectedValue == Contants.BSE) { dt = objDownload.downloadBSEEquityData(userVo.UserId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text)); } if (ddlAssetGroup.SelectedValue == Contants.Source.MF.ToString() && ddlSource.SelectedValue == Contants.AMFI) { dt = objDownload.downloadAmfiHistoricalData(userVo.UserId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text)); } gvResult.DataSource = dt; gvResult.DataBind(); } }