Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
While clicking the button in datagrid header, i will open a model PopUp window and get the input data and then close the window.
then in Parent window the link button is posted back through javascript.
at that time Page will perform the Page_Load Event and then triggers the checkbox checkedChanged Event(The CheckBox is Placed outside the DataGrid) and
then executes the linkbutton command (i.e DataGrid_ItemCommand Event).


Here i don't want to execute the checkbox checkedChanged.
guide me to solve this problem.
Posted
Comments
Zafar Sultan 26-Dec-12 9:09am    
Are you calling your checkbox checkedChanged event inside page load event?
PrabhuMuthusamy 27-Dec-12 0:13am    
No i'm not calling the checkedchange event in page load.
VishwaKL 26-Dec-12 23:08pm    
Dont give auto poat back property to check box
PrabhuMuthusamy 27-Dec-12 0:12am    
I need Checkbox checkedchanged event to be triggered on clicking the checkbox which can done by setting auto post back property to true.

1 solution

suppose your checkbox id is chkBox.

C#
string controlname = this.Request.Params.Get("__EVENTTARGET");

if(controlname  == "chkBox")
{
//Call your checkbox changed event here.
}


This condition will check if the postback is initiated by your checkbox. If any other control is initiating the postback your checkboxchanged event will not fire.

Hope it helps.
 
Share this answer
 

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