Click here to Skip to main content
15,891,022 members
Home / Discussions / ASP.NET
   

ASP.NET

 
RantRe: Windows Azure Free 1 week pass - 19 to 26 April Pin
Rutvik Dave21-Apr-10 5:23
professionalRutvik Dave21-Apr-10 5:23 
GeneralRe: Windows Azure Free 1 week pass - 19 to 26 April Pin
GoAzure22-Apr-10 9:34
GoAzure22-Apr-10 9:34 
GeneralRe: Windows Azure Free 1 week pass - 19 to 26 April [modified] Pin
GoAzure3-May-10 9:57
GoAzure3-May-10 9:57 
QuestionForce a PostBack? Page will not repopulate after first Click Pin
PDTUM20-Apr-10 6:29
PDTUM20-Apr-10 6:29 
AnswerRe: Force a PostBack? Page will not repopulate after first Click Pin
daveyerwin20-Apr-10 6:50
daveyerwin20-Apr-10 6:50 
GeneralRe: Force a PostBack? Page will not repopulate after first Click Pin
PDTUM20-Apr-10 7:02
PDTUM20-Apr-10 7:02 
GeneralRe: Force a PostBack? Page will not repopulate after first Click Pin
Not Active20-Apr-10 7:20
mentorNot Active20-Apr-10 7:20 
GeneralRe: Force a PostBack? Page will not repopulate after first Click Pin
PDTUM20-Apr-10 7:39
PDTUM20-Apr-10 7:39 
Thank you for your help, Mark. Here is the full text:

//The Button Code
protected void ButtonGoBack_Click(object sender, EventArgs e)
{
    LoadPreviousVersion();
}


//The Method Call
private void LoadPreviousVersion()
   {
       //Get requested version and test result
       int requestedVersion = (int.Parse(LabelVersion.Text)) - 1;
       if (requestedVersion < 1)
           requestedVersion = 1;

       //Set Label for new version
       LabelVersion.Text = requestedVersion.ToString();

       //Determine Edit Button availability
       if (int.Parse(LabelVersion.Text) != int.Parse(lastCompletedVersion))
           ButtonEdit.Enabled = false;
       else
           ButtonEdit.Enabled = true;

       //Create Medical Date
       medDate = CreateMedicalDate(medDate);

       //Load the results for the requested AE

       //Create a new SQL Connection Object
       SqlConnection Conn = new SqlConnection(CONNSTR);

       try
       {
           string Sql = "SELECT [Id],[Period] , [Screening_Number] , [Site_Number] , " +
           "[Version_Id],[Version] , [Ae] , [Frequency] , [Visit] , [VisitNumber] , [Date_Onset] , " +
           "[Ongoing] , [Date_Ended] , [CTCAE] , [Serious] , [Related] , [Action] , [Outcome] , " +
           "[NewConMedsY], [NewConMedsN], [SubBy] , [SubOn] , [Sae_Rpt_Status] " +
           "FROM Adverse_Events WHERE [Version_Id] = @Version_Id AND [Version] = @RequestedVersion ";

           //Set Command Object Headers
           SqlCommand Comm = new SqlCommand(Sql, Conn);
           Comm.CommandType = CommandType.Text;

           //Comm Paramemters
           Comm.Parameters.Clear();
           Comm.Parameters.AddWithValue("@Version_Id", Version_Id);
           Comm.Parameters.AddWithValue("@RequestedVersion", requestedVersion);

           //Create a Dataset
           SqlDataAdapter da = new SqlDataAdapter(Comm);
           DataSet ds = new DataSet();
           da.Fill(ds);

           //Send results to the controls
           LabelPeriod.Text = ds.Tables[0].Rows[0]["Period"].ToString();
           LabelScreeningNumber.Text = ds.Tables[0].Rows[0]["Screening_Number"].ToString();
           LabelVersion.Text = ds.Tables[0].Rows[0]["Version"].ToString();
           LabelId.Text = ds.Tables[0].Rows[0]["Id"].ToString();
           LabelAe.Text = ds.Tables[0].Rows[0]["Ae"].ToString();
           LabelFrequency.Text = ds.Tables[0].Rows[0]["Frequency"].ToString();
           LabelVisit.Text = ds.Tables[0].Rows[0]["Visit"].ToString();
           LabelVisitNum.Text = ds.Tables[0].Rows[0]["VisitNumber"].ToString();
           LabelDateStarted.Text = ds.Tables[0].Rows[0]["Date_Onset"].ToString();
           LabelOngoing.Text = ds.Tables[0].Rows[0]["Ongoing"].ToString();
           LabelDateStopped.Text = ds.Tables[0].Rows[0]["Date_Ended"].ToString();
           LabelCtcae.Text = ds.Tables[0].Rows[0]["CTCAE"].ToString();
           LabelSerious.Text = ds.Tables[0].Rows[0]["Serious"].ToString();
           LabelRelated.Text = ds.Tables[0].Rows[0]["Related"].ToString();
           LabelAction.Text = ds.Tables[0].Rows[0]["Action"].ToString();
           LabelOutcome.Text = ds.Tables[0].Rows[0]["Outcome"].ToString();
           RadioButtonConMedY.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewConMedsY"].ToString());
           RadioButtonConMedN.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["NewConMedsN"].ToString());
           LabelSubBy.Text = Session["Name"].ToString();
           LabelSubOn.Text = medDate;

       }
       catch (Exception ex)  //Catch Errors
       {
           Console.WriteLine("Error : " + ex.Message);
       }

       //Response.Write("<script>document.forms[0].submit();</script>");

   }

GeneralRe: Force a PostBack? Page will not repopulate after first Click Pin
Not Active20-Apr-10 8:44
mentorNot Active20-Apr-10 8:44 
AnswerRe: Force a PostBack? Page will not repopulate after first Click Pin
PDTUM20-Apr-10 9:26
PDTUM20-Apr-10 9:26 
GeneralRe: Force a PostBack? Page will not repopulate after first Click Pin
daveyerwin20-Apr-10 7:26
daveyerwin20-Apr-10 7:26 
AnswerRe: Force a PostBack? Page will not repopulate after first Click Pin
PDTUM20-Apr-10 9:27
PDTUM20-Apr-10 9:27 
Questionwhen checkboxes is selected the data should be store in two tables Pin
developerit20-Apr-10 3:16
developerit20-Apr-10 3:16 
AnswerRe: when checkboxes is selected the data should be store in two tables Pin
Brij20-Apr-10 3:30
mentorBrij20-Apr-10 3:30 
AnswerRe: when checkboxes is selected the data should be store in two tables Pin
Ashfield20-Apr-10 9:19
Ashfield20-Apr-10 9:19 
AnswerRe: when checkboxes is selected the data should be store in two tables Pin
nagendrathecoder21-Apr-10 1:22
nagendrathecoder21-Apr-10 1:22 
QuestionCustom control in popups Pin
Michael O.20-Apr-10 1:21
Michael O.20-Apr-10 1:21 
AnswerRe: Custom control in popups Pin
Brij20-Apr-10 1:53
mentorBrij20-Apr-10 1:53 
AnswerRe: Custom control in popups Pin
Jamil Hallal20-Apr-10 21:51
professionalJamil Hallal20-Apr-10 21:51 
QuestionInitializing ASP.NET Pin
Yoyosch20-Apr-10 0:39
Yoyosch20-Apr-10 0:39 
AnswerRe: Initializing ASP.NET Pin
Morgs Morgan20-Apr-10 0:43
Morgs Morgan20-Apr-10 0:43 
GeneralRe: Initializing ASP.NET Pin
Yoyosch20-Apr-10 0:54
Yoyosch20-Apr-10 0:54 
AnswerRe: Initializing ASP.NET Pin
Brij20-Apr-10 0:53
mentorBrij20-Apr-10 0:53 
GeneralRe: Initializing ASP.NET Pin
Yoyosch20-Apr-10 1:11
Yoyosch20-Apr-10 1:11 
GeneralRe: Initializing ASP.NET Pin
Brij20-Apr-10 1:13
mentorBrij20-Apr-10 1:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.