Passing Query String and read the string

protected void btnDetails_Click(object sender, EventArgs e)
{
String BtnIdentification = ((Control)sender).ID.ToString();

Response.Redirect("frmScriptSubmissionSummary.aspx?qsTermId=" + DrpListTermId.Text.Trim() + "&qsQueryOption=" + BtnIdentification.Trim());
}

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TermId = Request.QueryString["qsTermId"].ToString();
QueryOption = Request.QueryString["qsQueryOption"].ToString();
LabelMsg.Text = "Under Construction for- " + TermId + " ; " + QueryOption;
//btnClassTest
//btnSectionA
//btnScrutinizeA
//btnSectionB
//btnScrutinizeB
//btnSessional
//btnCenteralViva

if (QueryOption == "btnClassTest")
{
String Qs = "SELECT T_Term_Script_Submission_Status_Compact.CourseId, T_Term_Course_Offer.CourseCode, " +
" T_Term_Script_Submission_Status_Compact.TeacherId FROM T_Term_Script_Submission_Status_Compact LEFT OUTER JOIN " +
" T_Term_Course_Offer ON T_Term_Script_Submission_Status_Compact.TermId = T_Term_Course_Offer.TermId AND " +
" T_Term_Script_Submission_Status_Compact.CourseId = T_Term_Course_Offer.CourseId" +
" WHERE T_Term_Course_Offer.CourseType='Theory' AND T_Term_Script_Submission_Status_Compact.TermId='" + TermId + "'"+
" AND T_Term_Script_Submission_Status_Compact.AttendanceClassTest is null";
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s