Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
JavaScript Alert in not working in _RowUpdating event
posted

I have wriiten alert message as below in my webdatagrid_rowUpdating event.

if(APUtility.ToDateTime(e.Values["PTOStartDate"]) < System.DateTime.Now || APUtility.ToDateTime(e.Values["PTOSEndDate"]) < System.DateTime.Now)

{

String Message = PtoPopUpMessages(clsKeyDatesAndMetrics.clsKeyDatesAndMetricsRepalcementString.PTO_POPUP_VAL_PASTPTONONEDIT);

ScriptManager.RegisterStartupScript(wdgPTODetails, wdgPTODetails.GetType(), "Alerts", "alert('" + Message.ToString() + "')", true);

}

wdgPTODetails is my gird name. i am getting the message from database and wantted to show as alert. during debug i found that control goes to the statement but the alert message not popping up. please help.

my Design page looks like as below

<ig:webdatagrid id="wdgPTODetails" runat="server" autogeneratecolumns="False" height="350px"onrowadding="wdgPTODetails_RowAdding" onrowupdating="wdgPTODetails_RowUpdating" width="557px" ondatabound="wdgPTODetails_DataBound" DataKeyFields="PTOID">

<Columns>

<ig:BoundDataField DataFieldName="PTOID" Hidden="true" Key="PTOID"                          

DataType="System.Int32">

<Header Text="Pto_id" />

</ig:BoundDataField>

<ig:BoundDataField DataFieldName="UserID" Key="UserID" DataType="System.Int32">

 <Header Text="TM Name" /></ig:BoundDataField>

<ig:BoundDataField DataFieldName="PTOStartDate" Key="PTOStartDate"                              

DataType="System.DateTime"><Header Text="Start Date" />

<Footer Text="Start Date" /></ig:BoundDataField>

<ig:BoundDataField DataFieldName="PTOEndDate" Key="PTOEndDate"                

DataType="System.DateTime">

 <Header Text="End Date" />

</ig:BoundDataField>

 <ig:BoundDataField DataFieldName="PTOStatus" Key="PTOStatus">

<Header Text="Status" />

 <Footer Text="Status" />

 </ig:BoundDataField>

 </Columns>

 

behaviour section as below

<ig:EditingCore AutoCRUD="False">

<ig:CellEditing EditModeActions-EnableF2="true" EditModeActions-MouseClick="Single" EditModeActions-EnableOnKeyPress="true"

 Enabled="true">

<EditModeActions  MouseClick="Single"/>

 <ig:EditingColumnSetting ColumnKey="UserID" ReadOnly="true" ValidatorID="RequiredFieldValidator1"/>

<ig:EditingColumnSetting ColumnKey="PTOStatus" ReadOnly="True" />

<ig:EditingColumnSetting ColumnKey="PTOStartDate" EditorID="PTO_DatePicker" ValidatorID="RequiredFieldValidator1"/>

<ig:EditingColumnSetting ColumnKey="PTOEndDate" EditorID="PTO_DatePicker" ValidatorID="RequiredFieldValidator1"/>

</ColumnSettings>

</ig:CellEditing>


 

Parents Reply Children