<%@ page language="C#" autoeventwireup="true" inherits="Forms_News, App_Web_g5xbs2h3" enableeventvalidation="false" %>

<%--<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>--%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/New_Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/New_Footer.ascx" TagName="Footer" TagPrefix="uc2" %>
<%@ Register TagPrefix="cc" Namespace="Winthusiasm.HtmlEditor" Assembly="Winthusiasm.HtmlEditor" %>

<%--<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.2, Version=8.2.10.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2, Version=8.2.10.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.2.Export" Namespace="DevExpress.Web.ASPxGridView.Export"
    TagPrefix="exp" %>--%>

<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web" TagPrefix="dxw" %>
<%@ Register Assembly="DevExpress.Web.ASPxHtmlEditor.v14.2" Namespace="DevExpress.Web.ASPxHtmlEditor" TagPrefix="dxh" %>

<%--********* For Bootstrap Implementation *************--%>
<!DOCTYPE html>
<html lang="en">
<%--********* End of Bootstrap Implementation *************--%>
<head id="Head1" runat="server">
    <title>tSense-IoT News Master</title>
    <link href="../css/CustomeAlert/demos.css" rel="stylesheet" type="text/css" />
    <link href="../css/CustomeAlert/themes/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <%--********* For Bootstrap Implementation *************--%>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <%--********* End of Bootstrap Implementation *************--%>
    <link id="reset" runat="server" href="../css/reset.css" rel="stylesheet" type="text/css" />
    <link id="stylesheet2" runat="server" href="../css/stylesheet2.css" rel="stylesheet"
        type="text/css" />
    <link id="updatedcss" runat="server" href="../css/Updated_css.css" rel="stylesheet"
        type="text/css" />
    <link id="dropdown" runat="server" href="../css/dropdown.css" rel="stylesheet" type="text/css" />
    <link id="uidatepicker" runat="server" type="text/css" href="../css/ui.datepicker.css"
        rel="stylesheet" />
    <link id="uicore" runat="server" type="text/css" href="../css/ui.core.css" rel="stylesheet" />
    <link id="uitheme" runat="server" type="text/css" href="../css/ui.theme.css" rel="stylesheet" />
    <link id="ieonly" runat="server" href="" rel="stylesheet" type="text/css" />

    <%--Custom Theme for DevEx 14.2--%>
    <link id="GridView" runat="server" type="text/css" href="~/App_Themes/Office2003Blue/GridView/grid.css" rel="stylesheet" />
    <link id="Editors" runat="server" type="text/css" href="~/App_Themes/Office2003Blue/Editors/styles.css" rel="stylesheet" />
    <script type="text/javascript" src="../js/ScriptToClearCtrls.js"></script>
    <script src="../js/myformvalidations.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/jquery.min.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/CustomAlert.js" type="text/javascript"></script>
    <%--<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>--%>
    <script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="../js/DateValidations.js"></script>
    <script type="text/javascript" src="../js/ui.datepicker.js"></script>
    <script type="text/javascript" src="../js/JQQueryDatePicker.js"></script>

    <link rel="SHORTCUT ICON" href="../images/favicon.ico" />

    <%--********* For Bootstrap Implementation *************--%>
    <link id="BootStrapCss" href="../css/bootstrap.css" runat="server" rel="stylesheet" type="text/css" />
    <link id="mainstyle" runat="server" href="../css/mainstyle.css" rel="stylesheet" type="text/css" />
    <%--********* End of Bootstrap Implementation *************--%>
    <script src="../js/wow.min.js"></script>
</head>
<body>
    <%--********* For Bootstrap Implementation *************--%>
    <div class="pageContainer">
        <%--********* End of Bootstrap Implementation *************--%>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="smNews" runat="server">
            </asp:ScriptManager>
            <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <asp:PostBackTrigger ControlID="ibtSaveNews" />
                <asp:PostBackTrigger ControlID="ibtUpdateNews" />
            </Triggers>
            <ContentTemplate>--%>
            <%--UpdateMode="Always"--%>
            <!-- Header Starts Here -->
            <uc1:Header ID="ucHeader" runat="server" />
            <!-- Nav Ends Here -->
            <!-- Content Starts Here -->
            <div id="outer">
                <div id="inner">
                    <div id="float-wrap">
                        <!-- Do not delete 'btnTest' Button -->
                        <asp:Button ID="btnTest" Text="Test" CssClass="ControlHide" runat="server" OnClick="btnTest_Click" />
                        <!-- Main Content Starts Here -->
                        <div id="content">
                            <div class="content-wrap">
                                <div id="top-content" class="container-fluid head-part">
                                    <div id="heading" class="col-sm-4 col-md-4">
                                        <img class="icon" src="../images/configuration-icon.jpg" alt="" />
                                        <h1>
                                            <asp:Literal ID="lblConfigurationCaption" runat="server"></asp:Literal></h1>
                                        <asp:LinkButton ID="lnkHomeCaption" runat="server"></asp:LinkButton><span>&gt;</span><span><a
                                            href="News.aspx"><asp:Label ID="lblManageCaption" Text="Manage News" runat="server"></asp:Label></a></span>
                                    </div>
                                    <div id="" class="col-sm-7 col-md-7 pull-right">
                                        <div class="pull-right btn-wrap">
                                            <asp:ImageButton ID="lbtAddNews" runat="server" OnClick="lbtAddNews_Click" Visible="false"
                                                ImageUrl="~/images/add-news.png"></asp:ImageButton>
                                            <asp:LinkButton ID="lnkAddNews" runat="server" CssClass="MultilingualBtn" OnClick="lbtAddNews_Click">
                                                <span id="Span1" runat="server" class="MultilingualBtnspan">
                                                    <div class="AddGeozone">
                                                        <div id="AddNewsDiv" runat="server" class="MultilingualBtnTextAlign">
                                                            Add News
                                                        </div>
                                                    </div>
                                                </span>
                                            </asp:LinkButton>

                                            <asp:HyperLink ID="lbtConfiguration" runat="server" Visible="false" NavigateUrl="~/Forms/ConfigurationSetup.aspx"
                                                ImageUrl="~/images/btn-back-to-configuration.jpg"></asp:HyperLink>
                                            <asp:LinkButton ID="btnBack" runat="server" CssClass="MultilingualBtn" PostBackUrl="~/Forms/ConfigurationSetup.aspx">
                                                <span id="Span2" runat="server" class="MultilingualBtnspan">
                                                    <div class="Back">
                                                        <div id="BacktoConfigurationDiv" runat="server" class="MultilingualBtnTextAlign">
                                                            Back to Configuration
                                                        </div>
                                                    </div>
                                                </span>
                                            </asp:LinkButton>
                                        </div>
                                    </div>
                                    <div class="clear clearfix">
                                    </div>
                                </div>
                                <div class="clear clearfix">
                                </div>
                                <asp:Panel ID="pnlNews" runat="server" CssClass="ControlShow">
                                    <div class="form-box">
                                        <h1>
                                            <span class="icon" style="padding-top: 0px">
                                                <img src="../images/News Details.png" alt="" />
                                            </span>
                                            <asp:Label ID="lblNewsList" runat="server" Text="News Details"></asp:Label>
                                        </h1>
                                    </div>
                                    <div class="col-sm-12 form-box">

                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblNewsName" runat="server" CssClass="label" Text="News Name"></asp:Label>
                                                    &nbsp;
                                                     <asp:Label ID="Label14" runat="server" ForeColor="Red">*</asp:Label>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:TextBox ID="txtNewsName" runat="server" MaxLength="50" TabIndex="1" class="form-control"></asp:TextBox><%--onchange="ValidateNewsName();"onkeypress="return chkAlphaNumericWithSpace(event,this,49)"--%>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblNewsDesc" runat="server" CssClass="label" Text="News Description"></asp:Label>
                                                    <asp:Label ID="lblMaxChar" runat="server" Text="(Max 1000 Char.)"></asp:Label>
                                                </div>
                                                <div class="col-sm-7 col-xs-10 col-lg-6">
                                                    <asp:TextBox ID="txtNewsDesc" runat="server" Height="160px" TextMode="MultiLine" class="form-control" Style="max-width: 500px; width: 100%"
                                                        MaxLength="1000" TabIndex="2" onblur="return disallowScriptTags(this);" onkeypress="return ChkDescription(event,this,999);"></asp:TextBox>
                                                    <%-- <CKEditor:CKEditorControl ID="Editor" runat="server" Height="200px" Width="700px"


                                                            Toolbar="Basic"></CKEditor:CKEditorControl>--%>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblAuthorName" runat="server" CssClass="label" Text="Author Name"></asp:Label>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:TextBox ID="txtAuthorName" runat="server" class="form-control"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblImage" runat="server" CssClass="label" Text="Upload Image"></asp:Label>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:FileUpload ID="fuImage" runat="server" />
                                                    <asp:Label ID="lblFileSize" runat="server" Text="File size not more than 1MB"></asp:Label>
                                                    <%--<asp:Label ID="Label2" runat="server" ForeColor="Red">*</asp:Label>&nbsp;--%>
                                                    <asp:Image ID="imgAuthorImage" runat="server" Visible="false" Width="100px" Height="100px" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls ControlHide">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblNewsType" runat="server" CssClass="label" Text="News Type"></asp:Label>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:CheckBox ID="chkLinkable" runat="server" Text="Is Linkable" onclick="ShowOrHideDocumentURL()"></asp:CheckBox>
                                                    <asp:CheckBox ID="chkHighLight" runat="server" Text="Is Highlight" onclick="CheckOrUnCheckHightLight()"></asp:CheckBox>
                                                </div>
                                            </div>
                                        </div>
                                        <div id="trDocumentURL" runat="server" class="col-sm-8 form-controls ControlHide">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblDocumentURL" runat="server" CssClass="label" Text="Document URL"></asp:Label>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:TextBox ID="txtURL" runat="server" class="form-control" Width="250px"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblFromCaption" runat="server" CssClass="label" Text="Publish Date"></asp:Label>
                                                    <span style="color: Red">*</span>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:HiddenField runat="server" ID="hdnDateFormat" Value="dd-MMM-yyyy" />
                                                    <asp:TextBox ID="txtEffectiveFrom" runat="server" oncopy="return false" class="form-control" oncut="return false"
                                                        onkeypress="return false" onpaste="return false" ToolTip="dd-MMM-yyyy" TabIndex="25"
                                                        onkeydown="doCheckBackSpaceOrDelete()"></asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="col-sm-12 form-controls">
                                                <div class="col-sm-12 form-group">
                                                    <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                        <asp:Label ID="lblToCaption" runat="server" CssClass="label" Text="Expiry Date"></asp:Label>
                                                        <span style="color: Red">*</span>
                                                    </div>
                                                    <div class="col-sm-4">
                                                        <asp:TextBox ID="txtEffectiveTo" runat="server" oncopy="return false" class="form-control" oncut="return false"
                                                            onkeypress="return false" onpaste="return false" ToolTip="dd-MMM-yyyy" TabIndex="26"></asp:TextBox><%-- onkeydown="doCheckBackSpaceOrDelete()"--%>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-3 col-xs-10 col-lg-2 caption">
                                                    <asp:Label ID="lblPDFFile" runat="server" CssClass="label" Text="Release attachment(s)"></asp:Label>
                                                </div>
                                                <div class="col-sm-4">
                                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                                    <asp:Label ID="Label3" runat="server" Text="PDF Format file only."></asp:Label><br />
                                                    <asp:Label ID="lblPdfFileName" runat="server" Text="" ForeColor="Blue"></asp:Label>
                                                    <asp:LinkButton ID="lnkRemove" runat="server" OnClick="lnkRemove_Click" Style="text-decoration: none" Text="  [Remove]" Visible="false" ForeColor="Gray" Font-Bold="true"></asp:LinkButton>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-controls">
                                                <div class="col-sm-2 caption">
                                                </div>
                                                <div class="col-sm-10 checkbox">
                                                    <asp:CheckBox ID="chkIsPushNotification" runat="server" Text="IsPushNotification"></asp:CheckBox>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-2 caption">
                                                </div>
                                                <div class="col-sm-10">
                                                    <%--<asp:ImageButton ID="ibtSaveNews" runat="server" ImageUrl="~/images/btn-save.jpg"
                                                            OnClick="ibtSaveNews_Click" OnClientClick="return ValidateNewsInfo(true);" TabIndex="4" />--%>
                                                    <asp:LinkButton ID="ibtSaveNews" runat="server" CssClass="MultilingualBtn" OnClientClick="return ValidateNewsInfo(true);"
                                                        OnClick="ibtSaveNews_Click" ValidationGroup="vgFleet" TabIndex="4">
                                                        <span id="Span3" runat="server" class="MultilingualBtnspan">
                                                            <div class="Save">
                                                                <div id="AddNewsButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                    Save
                                                                </div>
                                                            </div>
                                                        </span>
                                                    </asp:LinkButton>&nbsp;
                                                <%--<asp:ImageButton ID="ibtUpdateNews" runat="server" ImageUrl="~/images/btn-update.jpg"
                                                            OnClick="ibtUpdateNews_Click" OnClientClick="return ValidateNewsInfo(true);"
                                                            TabIndex="5" />--%>
                                                    <asp:LinkButton ID="ibtUpdateNews" runat="server" CssClass="MultilingualBtn" OnClientClick="return ValidateNewsInfo(true);"
                                                        OnClick="ibtUpdateNews_Click" ValidationGroup="vgFleet" TabIndex="5">
                                                        <span id="Span4" runat="server" class="MultilingualBtnspan">
                                                            <div class="Save">
                                                                <div id="UpdateNewsButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                    Update
                                                                </div>
                                                            </div>
                                                        </span>
                                                    </asp:LinkButton>
                                                    &nbsp;
                                                <%-- <asp:ImageButton ID="ibtCancelNews" runat="server" ImageUrl="~/images/btn-cancel.jpg"
                                                            OnClick="ibtCancelNews_Click" TabIndex="6" />--%>
                                                    <asp:LinkButton ID="ibtCancelNews" runat="server" CssClass="MultilingualBtn" OnClick="ibtCancelNews_Click"
                                                        TabIndex="6">
                                                        <span id="Span5" runat="server" class="MultilingualBtnspan">
                                                            <div class="Cancel">
                                                                <div id="CancelDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                    Cancel
                                                                </div>
                                                            </div>
                                                        </span>
                                                    </asp:LinkButton>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-8 form-controls">
                                            <div class="col-sm-12 form-group">
                                                <div class="col-sm-6 caption">
                                                    <asp:Label ID="Label1" runat="server" ForeColor="Red">*</asp:Label>&nbsp;
                                                <asp:Label ID="lblMandatory" runat="server" Text="Required Fields"></asp:Label>
                                                </div>
                                                <div class="col-sm-6">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>

                                <asp:Panel ID="pnlNewsDetails" runat="server" CssClass="ControlShowSendCommands">
                                    <div class="form-box">
                                        <h1>
                                            <span class="icon">
                                                <img src="../images/Manage News.png" alt="" />
                                            </span>
                                            <asp:Label ID="lblManageNews" runat="server" Text="Manage News"></asp:Label></h1>
                                    </div>
                                    <asp:UpdatePanel ID="upNews" runat="server">
                                        <Triggers>
                                            <asp:PostBackTrigger ControlID="gvNews" />
                                        </Triggers>
                                        <ContentTemplate>
                                            <div id="grid-dsply">
                                                <div class="table-responsive">
                                                    <dxw:ASPxGridView ID="gvNews" ClientInstanceName="gvNews" KeyFieldName="NewsId" runat="server"
                                                        CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" CssPostfix="Office2003_Blue"
                                                        EnableTheming="true" Theme="Office2003Blue" Width="100%" AutoGenerateColumns="False"
                                                        OnAfterPerformCallback="gvNews_AfterPerformCallback" OnHtmlRowCreated="gvNews_HtmlRowCreated">
                                                        <%--<Images ImageFolder="~/App_Themes/Office2003Blue/GridView/">
                                                    <CollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                        Width="11px" />
                                                    <ExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                        Width="11px" />
                                                    <DetailCollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                        Width="11px" />
                                                    <DetailExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                        Width="11px" />
                                                </Images>--%>
                                                        <Styles AlternatingRow-Enabled="True" CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css"
                                                            CssPostfix="Office2003_Blue">
                                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                            </Header>
                                                            <LoadingPanel ImageSpacing="10px">
                                                            </LoadingPanel>
                                                            <PagerBottomPanel CssClass="PageFooter">
                                                            </PagerBottomPanel>
                                                            <PagerTopPanel CssClass="PageFooter">
                                                            </PagerTopPanel>
                                                        </Styles>
                                                        <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                            PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                            NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                            NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true">
                                                        </SettingsPager>
                                                        <Columns>
                                                            <dxw:GridViewDataColumn Caption="News Name" Width="42%" FieldName="NewsName" VisibleIndex="1">
                                                                <HeaderCaptionTemplate>
                                                                    <span class="icon">
                                                                        <img src="../images/News Name.png" align="top" alt="" /></span><span class="label">
                                                                            <asp:Label ID="lblNewsName" Text="News Name" runat="server"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn Caption="NewsDescription" Width="46%" FieldName="NewsDescription"
                                                                VisibleIndex="2" CellStyle-Wrap="True">
                                                                <HeaderCaptionTemplate>
                                                                    <span class="icon">
                                                                        <img src="../images/News Description.png" alt="" /></span><span class="label">
                                                                            <asp:Label ID="lblDescription" runat="server" Text="Description"></asp:Label></span>
                                                                </HeaderCaptionTemplate>
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataTextColumn Caption="View" Width="3%" Name="View" VisibleIndex="3">
                                                                <HeaderTemplate>
                                                                </HeaderTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:LinkButton ID="ibView" runat="server" OnClick="ibtViewNews_click" CommandArgument='<%# Eval("NewsId") %>'
                                                                        Style="text-decoration: none;"><img src="../images/icn-view.gif"/></asp:LinkButton>
                                                                </DataItemTemplate>
                                                            </dxw:GridViewDataTextColumn>
                                                            <dxw:GridViewDataTextColumn Caption="Edit" Width="3%" HeaderStyle-HorizontalAlign="Center"
                                                                CellStyle-HorizontalAlign="Center" Name="Edit" VisibleIndex="4">
                                                                <HeaderTemplate>
                                                                </HeaderTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:ImageButton ID="ibtEditNews" runat="server" CommandArgument='<%# Eval("NewsId").ToString() %>'
                                                                        AlternateText="Edit" CommandName="Delete" ImageUrl="~/images/icn-edit.gif" OnClick="ibtEditNews_click"
                                                                        ToolTip="Click here to Edit" ImageAlign="Middle" CssClass="handButton" />
                                                                </DataItemTemplate>
                                                            </dxw:GridViewDataTextColumn>
                                                            <dxw:GridViewDataTextColumn Caption="Delete" VisibleIndex="5" HeaderStyle-HorizontalAlign="Center"
                                                                CellStyle-HorizontalAlign="Center" Width="3%">
                                                                <HeaderTemplate>
                                                                </HeaderTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:ImageButton ID="ibtDeleteNews" runat="server" CommandArgument='<%# Eval("NewsId") %>'
                                                                        AlternateText="Delete" CommandName="Delete" ImageUrl="~/images/delete-icon.gif"
                                                                        OnClick="ibtDeleteNews_click" ToolTip="Click here to Delete" ImageAlign="Middle"
                                                                        CssClass="handButton" />
                                                                </DataItemTemplate>
                                                            </dxw:GridViewDataTextColumn>
                                                            <dxw:GridViewDataTextColumn Caption="Send to mobile App Users" VisibleIndex="6"
                                                                HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center" Width="5%"
                                                                Name="SendNotification">
                                                                <HeaderTemplate>
                                                                </HeaderTemplate>
                                                                <DataItemTemplate>
                                                                    <asp:ImageButton ID="ibtSendNews" runat="server" CommandArgument='<%# Eval("NewsId")+","+Eval("NewsName") %>'
                                                                        AlternateText="Send to mobile App Users" CommandName="Send" ImageUrl="~/images/mobile.png"
                                                                        OnClick="ibtSendNews_click" ToolTip="Send to mobile App Users" ImageAlign="Middle"
                                                                        CssClass="handButton" Visible='<%# Eval("IsNotificationSent").ToString() == "False"  ? true : false %>' />
                                                                    <asp:ImageButton ID="ibtSendNewsDisable" runat="server" CommandArgument='<%# Eval("NewsId")+","+Eval("NewsName") %>'
                                                                        AlternateText="Send to mobile App Users" CommandName="Send" ImageUrl="~/images/icn-sms-users-Disable.gif"
                                                                        OnClick="ibtSendNews_click" ToolTip="Resend to mobile App Users" ImageAlign="Middle"
                                                                        CssClass="handButton" Visible='<%# Eval("IsNotificationSent").ToString() == "False"  ? false : true %>' />
                                                                </DataItemTemplate>
                                                            </dxw:GridViewDataTextColumn>
                                                        </Columns>
                                                        <%--<ClientSideEvents EndCallback="function(s, e) {document.getElementById('btnTest').click();}" />--%>
                                                        <Settings ShowStatusBar="Auto" ShowFilterRow="false" ShowGroupPanel="false" />
                                                        <SettingsText EmptyDataRow="No data available" />
                                                        <SettingsBehavior ColumnResizeMode="NextColumn" AllowSort="true" AllowDragDrop="true"
                                                            AllowGroup="true" AllowFocusedRow="false" />
                                                        <SettingsPager PageSize="10" Mode="ShowPager" AlwaysShowPager="true">
                                                        </SettingsPager>
                                                    </dxw:ASPxGridView>
                                                </div>
                                            </div>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </asp:Panel>
                            </div>
                        </div>
                        <asp:Panel ID="pnlInfoWindow" runat="server" class="container-fluid" Style="max-width: 500px; width: 100%;">
                            <asp:UpdatePanel ID="UpdatePanel8" runat="server">
                                <ContentTemplate>
                                    <div id="con">
                                        <div class="popup">
                                            <%--<table cellpadding="0" cellspacing="0" border="0" width="98%" class="popup">
                                                    <tr>
                                                        <td id="NotificationPnltopl" runat="server" class="top-l">&nbsp;
                                                        </td>
                                                        <td class="top-m">&nbsp;
                                                        </td>
                                                        <td id="NotificationPnltopr" runat="server" class="top-r">&nbsp;
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td id="Dashboardleft" runat="server">&nbsp;
                                                        </td>
                                                        <td>--%>
                                            <div class="top">
                                                <div class="DashboardNewsIcon">
                                                    <img class="icon" src="../images/news_icn.gif" alt="" />
                                                </div>
                                                <div class="DashboardNewsText">
                                                    <h1>
                                                        <asp:Label runat="server" ID="lblinfopnl" Text="News"></asp:Label></h1>
                                                </div>
                                                <div class="close">
                                                    <asp:ImageButton ID="ibtClose" runat="server" OnClientClick="CloseCategoryPopup(); return false;"
                                                        ImageUrl="~/Images/popup-close.gif" />
                                                </div>
                                                <div class="clear clearfix">
                                                </div>
                                            </div>
                                            <div class="">
                                                <div class="col-sm-12 form-tbl">
                                                    <div class="col-sm-5">
                                                        <img id="AuthorImage" height="150px" />
                                                    </div>
                                                    <div class="col-sm-7 nullpadding">
                                                        <div class="form-group">
                                                            <div class="col-sm-12 nullpadding">
                                                                <asp:Label ID="lblTopic" runat="server" Text="Title:" Font-Bold="true"></asp:Label>
                                                                <asp:Label ID="lblNewsTopic" runat="server"></asp:Label>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <div class="col-sm-12 nullpadding">
                                                                <asp:Label ID="lblAuthor" runat="server" Text="Author:" Font-Bold="true"></asp:Label>
                                                                <asp:Label ID="Label2" runat="server"></asp:Label>
                                                                <asp:Label ID="lblPublishCaption" runat="server" Text="Published On:" Font-Bold="true"></asp:Label>
                                                                <asp:Label ID="lblPublishDate" runat="server"></asp:Label>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <div class="col-sm-12 nullpadding">
                                                                <div id="lblNewDesc" runat="server" style="width: 100%; overflow-x: hidden; overflow: auto; word-wrap: break-word;">
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <%--</td>
                                                        <td id="Dashboardright" runat="server">&nbsp;
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td id="NotificationPnlbottoml" runat="server" class="bottom-l">&nbsp;
                                                        </td>
                                                        <td class="bottom-m">&nbsp;
                                                        </td>
                                                        <td id="NotificationPnlbottomr" runat="server" class="bottom-r">&nbsp;
                                                        </td>
                                                    </tr>
                                                </table>--%>
                                    </div>
                                    <asp:HiddenField ID="hdnLandmarkImage" runat="server" />
                                    <asp:HiddenField ID="hdnAuthorImage" runat="server" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </asp:Panel>

                        <script type="text/javascript">

                            var keyValue;
                            function OnMoreInfoClick(element, News, NewsDescription, Author, ImageName, OrgId, publishDate) {
                                //alert(NewsDescription);
                                document.getElementById("lblNewDesc").innerHTML = NewsDescription;
                                document.getElementById("lblNewsTopic").innerHTML = News;
                                document.getElementById("Label2").innerHTML = Author;
                                //document.getElementById("lblPublishDate").innerHTML = publishDate;
                                document.getElementById("AuthorImage").src = ((ImageName == null || ImageName == '') ? '../images/NewsDefaultImage.gif' : '../images/NewsImage/org_' + OrgId + '/' + ImageName);
                                //popup.ShowAtElement(element);
                                var isIE = CheckBrowser();
                                var pnlCategory = document.getElementById("pnlInfoWindow");
                                pnlCategory.style.display = "block";
                            }
                            function CloseCategoryPopup() {
                                var pnlCategory = document.getElementById("pnlInfoWindow");
                                pnlCategory.style.display = "none";
                            }
                            function popup_Shown(s, e) {

                                popup.ShowAtPos(s, e);
                            }

                        </script>

                        <!-- Main Content Ends Here -->
                        <div id="left">
                        </div>
                        <div class="clear clearfix">
                        </div>
                    </div>
                    <div id="right">
                    </div>
                </div>
            </div>
            <%--</ContentTemplate>
        </asp:UpdatePanel>--%>
            <asp:Button ID="btn" runat="server" OnClick="btn_click" Style="visibility: hidden" />

            <script type="text/javascript" language="javascript">
                function ShowOrHideDocumentURL() {
                    var chkLinkable, chkHighLight;
                    chkLinkable = document.getElementById("chkLinkable");
                    chkHighLight = document.getElementById("chkHighLight");
                    if (chkLinkable != null && chkLinkable.checked == true) {
                        document.getElementById("trDocumentURL").className = "ControlShowFF";
                        document.getElementById("chkHighLight").checked = false;
                    }
                    else {
                        document.getElementById("trDocumentURL").className = "ControlHide";
                    }
                }


                var Alert_Delete = "Do you want to delete this Entry.";

                function setAlertMessageDelete(Delete) {
                    Alert_Delete = Delete;
                }

                // Delete confirm
                function DeleteConfirm() {
                    return confirm(Alert_Delete);
                }
                function CheckOrUnCheckHightLight() {
                    var chkLinkable, chkHighLight;
                    chkLinkable = document.getElementById("chkLinkable");
                    chkHighLight = document.getElementById("chkHighLight");
                    if (chkHighLight != null && chkHighLight.checked == true) {
                        document.getElementById("trDocumentURL").className = "ControlHide";
                        document.getElementById("chkLinkable").checked = false;
                    }
                }

                //            jQuery(document).ready(function() {
                //                var prm = Sys.WebForms.PageRequestManager.getInstance();
                //                prm.add_endRequest(function() {
                //                    // This Function Will Called When Page Is Refreshed                    
                //                    if (document.getElementById('txtEffectiveFrom') != null) {
                //                        $('#txtEffectiveFrom').datepicker({
                //                            numberOfMonths: 1,
                //                            showButtonPanel: true,
                //                            dateFormat: 'dd-M-yy',
                //                            changeYear: true,
                //                            changeMonth: true,
                //                            hideIfNoPrevNext: true
                //                        });
                //                    }
                //                    if (document.getElementById('txtEffectiveTo') != null) {
                //                        $('#txtEffectiveTo').datepicker({
                //                            numberOfMonths: 1,
                //                            showButtonPanel: true,
                //                            dateFormat: 'dd-M-yy',
                //                            changeYear: true,
                //                            changeMonth: true,
                //                            hideIfNoPrevNext: true
                //                        });
                //                    }

                //                });

                //                if (document.getElementById('txtEffectiveFrom') != null) {
                //                    //End request ends here
                //                    $('#txtEffectiveFrom').datepicker({
                //                        numberOfMonths: 1,
                //                        showButtonPanel: true,
                //                        dateFormat: 'dd-M-yy',
                //                        changeYear: true,
                //                        changeMonth: true,
                //                        hideIfNoPrevNext: true
                //                    });
                //                }

                //                if (document.getElementById('txtEffectiveTo') != null) {
                //                    $('#txtEffectiveTo').datepicker({
                //                        numberOfMonths: 1,
                //                        showButtonPanel: true,
                //                        dateFormat: 'dd-M-yy',
                //                        changeYear: true,
                //                        changeMonth: true,
                //                        hideIfNoPrevNext: true
                //                    });
                //                }
                //            });

                function pageLoad() {

                    var chkLinkable;
                    chkLinkable = document.getElementById("chkLinkable");
                    if (chkLinkable != null && chkLinkable.checked == true) {
                        document.getElementById("trDocumentURL").className = "ControlShowFF";
                    }
                    else {
                        if (document.getElementById("trDocumentURL") != null) {
                            document.getElementById("trDocumentURL").className = "ControlHide";
                        }
                    }

                    if (document.getElementById('txtEffectiveFrom') != null) {
                        $jdp('#txtEffectiveFrom').datepicker({
                            numberOfMonths: 1,
                            showButtonPanel: true,
                            dateFormat: 'dd-M-yy',
                            changeYear: true,
                            changeMonth: true,
                            hideIfNoPrevNext: true,
                            onSelect: RestrictDate,
                            beforeShow: RestrictDate
                        });
                    }
                    if (document.getElementById('txtEffectiveTo') != null) {
                        $jdp('#txtEffectiveTo').datepicker({
                            numberOfMonths: 1,
                            showButtonPanel: true,
                            dateFormat: 'dd-M-yy',
                            changeYear: true,
                            changeMonth: true,
                            hideIfNoPrevNext: true,
                            beforeShow: RestrictDate
                            // beforeShow: function(dateText, inst) {
                            // var the_date = $('input[id$=txtEffectiveFrom]').datepicker('getDate');
                            // $("input[id$=txtEffectiveTo]").datepicker('option', 'minDate', the_date);
                            // }
                        });
                    }

                    function RestrictDate(dateText, inst) {
                        var fromDate = $jdp('input[id$=txtEffectiveFrom]').datepicker('getDate');
                        if (fromDate == null) {
                            $jdp('#txtEffectiveFrom').datepicker('option', 'minDate', new Date());
                            $jdp('#txtEffectiveTo').datepicker('option', 'minDate', new Date());
                        }
                        else {
                            $jdp('#txtEffectiveFrom').datepicker('option', 'minDate', new Date());
                            $jdp('#txtEffectiveTo').datepicker('option', 'minDate', new Date(fromDate));
                        }
                    }

                }

                function RemoveSpaces(fieldName) {
                    var s;
                    if (typeof (fieldName) == 'object') {
                        s = fieldName.value;
                    }
                    else {
                        s = fieldName;
                    }
                    s = s.replace(/(^\s*)|(\s*$)/gi, "");
                    s = s.replace(/[ ]{2,}/gi, " ");
                    s = s.replace(/\n /, "\n");
                    if (typeof (fieldName) == 'object') {
                        fieldName.value = s;
                    }
                    return s;
                }

                var Alert_NewsName = 'News Name already exists.';
                var Alert_News = 'Please enter the News Name.';
                var Alert_PublishDate = 'Please enter publish date';
                var Alert_Expiry = 'Please enter expiry date';

                function SetAlert(AlertNewsName, AlertNews, AlertPublishDate, AlertExpiry) {
                    Alert_NewsName = AlertNewsName;
                    Alert_News = AlertNews;
                    Alert_PublishDate = AlertPublishDate;
                    Alert_Expiry = AlertExpiry;
                }

                function ValidateNewsInfo(isNewsNameValid) {


                    //var data = document.getElementById('Editor');

                    var newsName = document.getElementById('txtNewsName');
                    var FromDate = document.getElementById('txtEffectiveFrom');
                    var ExpiryDate = document.getElementById('txtEffectiveTo');
                    var isError = false;
                    var controlToBeFocused;
                    var alertMessage = '';

                    if (!isNewsNameValid) {
                        isError = true;
                        alertMessage = Alert_NewsName;
                        newsName.style.backgroundColor = 'lightyellow';
                        controlToBeFocused = newsName;
                    }

                    if (RemoveSpaces(newsName).length == 0) {
                        isError = true;
                        controlToBeFocused = newsName;
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + Alert_News;
                        newsName.style.backgroundColor = 'lightyellow';
                    }
                    else {
                        newsName.style.backgroundColor = 'white';
                    }

                    if (FromDate.value.length == 0) {
                        isError = true;
                        controlToBeFocused = FromDate;
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + Alert_PublishDate;
                        FromDate.style.backgroundColor = 'lightyellow';
                    }

                    if (ExpiryDate.value.length == 0) {
                        isError = true;
                        controlToBeFocused = ExpiryDate;
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + Alert_Expiry;
                        ExpiryDate.style.backgroundColor = 'lightyellow';
                    }

                    if (isError) {
                        controlToBeFocused.focus();
                    }

                    if (isError) {
                        TrinetraCustomAlerts(alertMessage);
                        return false;
                    }
                    else {
                        return true;
                    }
                }

                function ValidateNewsName() {
                    document.getElementById('btn').click()
                }
                function SaveData(element) {
                    var data = document.getElementById('Editor');
                    //var value = element;
                }
            </script>


            <asp:HiddenField ID="hdnLogout" runat="server" />
        </form>
    </div>
    <!-- Content Ends Here -->
    <uc2:Footer ID="ucFooter" runat="server" />
</body>
</html>
