hi,
The below is the code for the one my project.
protected
void Page_Load(object sender, EventArgs e){
lblerr.Text =
"";username = Context.User.Identity.Name.Replace(
"SASKEN\\", ""); try{
if (!IsPostBack){
string Closed_Date = ""; int cmp = 0; SqlConnection conn = new SqlConnection(); SqlCommand cmd = new SqlCommand(); CultureInfo ci = new CultureInfo("en-GB", true);conn.ConnectionString = connstr;
cmd.Connection = conn;
cmd.CommandText =
"HRN_SP_CheckDateClosed";cmd.CommandType =
CommandType.StoredProcedure;cmd.Parameters.AddWithValue(
"@HRN_Yr", "" );cmd.Parameters.AddWithValue(
"@HRN_Qtr", "" );conn.Open();
SqlDataReader DR_ClsDate = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (DR_ClsDate != null){
if (DR_ClsDate.Read()){
Closed_Date = DR_ClsDate[0].ToString();
}
}
if (Closed_Date != ""){
DateTime DT1 = Convert.ToDateTime(Closed_Date);cmp =
DateTime.Compare(DateTime.Now, DT1);}
if (cmp <= 0){
pnlTOQ.Visible =
true;}
else{
pnlTOQ.Visible =
false;lblerr.Text =
"Award period is closed.";}
}
}
catch (Exception ex){
lblerr.Text = ex.Message;
lblerr.Visible =
true;}
finally{
conn.Close();
}
}
for the year and quarter, i need to pass the parameters from the other page.
Please help me what i need to pass for the same.
Regards,
Geetha
Vijaya KadiyalaPosted Apr 17, 2009, 1:22 PM
Hi
In addition to session you can even use QueryString. Check out the below link for complete information.
http://www.4guysfromrolla.com/articles/020205-1.aspx
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com
Niradhip ChakrabortyPosted Apr 10, 2009, 1:16 PM