Click here to Skip to main content
16,011,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,
I got a problem about updating the data in Modal popup extender. I have a detailview with the activity data and a link button to cancel the activity. When the can cancel activity button was click the popup is show and ask user to enter the reason of cancellation. Here is the link to my interface https://dl.dropbox.com/u/47780108/ModalPopupExtender.jpg[^]

I have tried to put some commands like sql update command in the event click for comfirm button. But nothing was happened. so how can i solve this problem. This is my first time for using modal popup. Please give me any suggestion.


Thanks for your kindly help.

Best regard,
Rose
Posted
Comments
deeptibansal 25-Sep-12 8:05am    
Please paste your code as well.

1 solution

C#
protected void btnUpdate_Click(object sender, EventArgs e)
{
    //Find your text box control here..
    
    //Take your TextBox value and do your save logic..

    //after this still if you want to show that ModalPopUp means use 
    ModalPopUpId.Show(); else ModalPopUpId.Hide();

}


Hope this will help you..
 
Share this answer
 
Comments
Cmajorros 26-Sep-12 2:42am    
I have tried this

//this is the event from the confirm button in Modal popup panel.
protected void btnConfirm_Click(object sender, EventArgs e)
{

string ActID = GridView1.SelectedRow.Cells[1].Text.ToString();
TextBox txtCancelDes = (TextBox)(this.FindControl("txtCancelDes"));
string Des = txtCancelDes.Text;
string CancelActivity;
CancelActivity = "UPDATE Activities SET Activity_Status = 'Canceled',Activity_CancelDes = '"+Des+"' WHERE Activity_ID = " + ActID + ";";
dbconn.QueryExecuteScalar(CancelActivity);
dbconn.Close();
MessageBox.Show("Done");
}

but it s still not work. I have tried to debug it by dropping the break point at the event btnConfirm_Click but when i run the page. it does not break at this event. the confirm button does not know this event.

Moreover, I have tried some codes here. It did not work too. there was no break when i drop a breakpoint at this event.

protected void btnCancelActivity_Click(object sender, EventArgs e)
{

string ActID = GridView1.SelectedRow.Cells[1].Text.ToString();
TextBox txtCancelDes = (TextBox)(this.FindControl("txtCancelDes"));
string Des = txtCancelDes.Text;
string CancelActivity;
CancelActivity = "UPDATE Activities SET Activity_Status = 'Canceled',Activity_CancelDes = '" + Des + "' WHERE Activity_ID = " + ActID + ";";
dbconn.QueryExecuteScalar(CancelActivity);
dbconn.Close();
MessageBox.Show("Done");
}

Is there any suggestion ? Thanks for your kindly help again
V_R 26-Sep-12 5:14am    
If that break point is not coming means problem with PostBack,
set AutoPostBack="true" of that button and try..

All the best..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900