Hi Can anyone help me?
I have a Javascript function in my test.aspx as follow:-
<script language="Javas cript">
function confirm_save()
{
if (confirm("Are you sure you want to save this changed?")==tru e)
return true;
else
return false;
}
</script>
Note:-
1. I know this can be called by <input .... type BUTTON and
2. <linkbutton.. ..
3. <asp:button.. ..
BUT My case is different, as follows:-
I have a datagrid to display in the test.aspx, the datagrid have a EDIT button, and this button is not customize by me, when I configure property builder of the datagrid, I simply add it (template column).
If you take a look at the HTML test.aspx, you can notice below:-
<TR>
<TD bgColor="inacti vecaptiontext" colSpan="2"><as p:datagrid id="datagrid" runat="server" CssClass="boldt ext" Width="60%" ForeColor="Blac k" GridLines="Hori zontal" AllowPaging="Tr ue" CellPadding="4" BorderWidth="1p x" BorderStyle="No ne" BorderColor="#C CCCCC" AutoGenerateCol umns="False" BackColor="Whit e" OnCancelCommand ="OnCancel" OnUpdateCommand ="OnSave" OnEditCommand=" OnEdit">
<AlternatingIte mStyle ............... .
<asp:BoundColum n....
<asp:BoundColum n....
<asp:EditComman dColumn ButtonType="Pus hButton" UpdateText="Sav e" CancelText="Can cel" EditText="Edit" ></asp:EditCommand Column>
</asp: datagrid>
</TR>
and this is all automatice by datagrid, because, when I click edit, it will run the code ->, refer to OnEditCommand=" OnEdit" above.
public void OnEdit(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
datagrid.EditIt emIndex = -1;
BindData(); }
THEN THE Save and Cancel Button are automatically appear. after click Edit Button.
Then I can change value on the Non-Readonly datagrid column, after change, when I click save, it will trigger OnSave method in my code behind.refer to OnUpdateCommand ="OnSave" above.
>>>>>>
WHAT I REQUIRED ARE:- when I click Save, it will prompt out a confirmation message box. can anyone please help me?
>>>>>>
I have a Javascript function in my test.aspx as follow:-
<script language="Javas cript">
function confirm_save()
{
if (confirm("Are you sure you want to save this changed?")==tru e)
return true;
else
return false;
}
</script>
Note:-
1. I know this can be called by <input .... type BUTTON and
2. <linkbutton.. ..
3. <asp:button.. ..
BUT My case is different, as follows:-
I have a datagrid to display in the test.aspx, the datagrid have a EDIT button, and this button is not customize by me, when I configure property builder of the datagrid, I simply add it (template column).
If you take a look at the HTML test.aspx, you can notice below:-
<TR>
<TD bgColor="inacti vecaptiontext" colSpan="2"><as p:datagrid id="datagrid" runat="server" CssClass="boldt ext" Width="60%" ForeColor="Blac k" GridLines="Hori zontal" AllowPaging="Tr ue" CellPadding="4" BorderWidth="1p x" BorderStyle="No ne" BorderColor="#C CCCCC" AutoGenerateCol umns="False" BackColor="Whit e" OnCancelCommand ="OnCancel" OnUpdateCommand ="OnSave" OnEditCommand=" OnEdit">
<AlternatingIte mStyle ............... .
<asp:BoundColum n....
<asp:BoundColum n....
<asp:EditComman dColumn ButtonType="Pus hButton" UpdateText="Sav e" CancelText="Can cel" EditText="Edit" ></asp:EditCommand Column>
</asp: datagrid>
</TR>
and this is all automatice by datagrid, because, when I click edit, it will run the code ->, refer to OnEditCommand=" OnEdit" above.
public void OnEdit(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{
datagrid.EditIt emIndex = -1;
BindData(); }
THEN THE Save and Cancel Button are automatically appear. after click Edit Button.
Then I can change value on the Non-Readonly datagrid column, after change, when I click save, it will trigger OnSave method in my code behind.refer to OnUpdateCommand ="OnSave" above.
>>>>>>
WHAT I REQUIRED ARE:- when I click Save, it will prompt out a confirmation message box. can anyone please help me?
>>>>>>
Comment