Click here to Skip to main content
15,995,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

I am making a CRM website in asp.net using c#, in this i have a requirement for editing customer complaints.

In one page ComplaintActions.aspx i have one gridview in which i display all the complaints to date, and also in that gridview i have three template fields "Edit" , "Delete", "Mail" complaints, now what i have done is on Edit complaint click i have simply redirected the whole complaint data to a javascript popup.. like this..

XML
<asp:TemplateField HeaderText="Edit Complaint">
                                  <ItemTemplate >
                                    <a href="javascript:Openpopup('EditComplaint.aspx?ComplaintId=<%# Eval("ComplaintId") %>&CompNo=<%#Eval("ComplaintNumber") %>&CompTitle=<%# Eval("ComplaintTitle") %>&CompDesc=<%# Eval("ComplaintDescription") %>&SchName=<%# Eval("SchoolName") %>&Zn=<%# Eval("ZoneName") %>&Zm=<%# Eval("ZonalManager") %>&RpDate=<%# Eval("ReportedDate") %>&CmpStatus=<%# Eval("ComplaintStatusId") %>&DtOfClosure=<%# Eval("ComplaintClosedDate") %>&NoOfDays=<%# Eval("NumberOfDays") %>&EngName=<%# Eval("EngineersName") %>')">
                                      <asp:Label ID="Label1" runat="server" Text="Edit"></asp:Label>
                                  </ItemTemplate>
                                  <ItemStyle Width="100px" />
                              </asp:TemplateField>


Now what i need is the edit complaint template field should not redirect to EditComplaint.aspx popup page if the complaint is already closed...

I dont want to use RowCommand event in this... Please help me regarding this...

Thanks & Regards,
Krunal Panchal
Posted

1 solution

hi dear

Use function like below and call it on click of your href or link button.

JavaScript
function openNewWindow(Path, isAllow) {
            try {
                if (isAllow.trim() != "" && parseInt(isAllow) != 0) {
                    var width = 400;
                    var height = 430;
                    var left = parseInt((screen.availWidth / 2) - (width / 2));
                    var top = parseInt((screen.availHeight / 2) - (height / 2));
                    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
                    window.open(Path, "_Blank", windowFeatures)
                }
            }
            catch (e) {
                return false;
            }
            return false;
        }


now call in gridviewcolumn

C#
<dx:gridviewdatabinaryimagecolumn caption="More Info" visible="true" fieldname="Pending OD" xmlns:dx="#unknown">
                                                           <dataitemtemplate>
                                                               <a href="javascript:void(0);" onclick="return openNewWindow('../Transactions/popup.aspx?&id=','<%#Eval(" id=") %>',,'<%#Eval(" isallow=")%>');">
                                                                   <asp:label id="Label2" runat="server" text="More Info" tooltip="Click Here To More Info" xmlns:asp="#unknown"></asp:label>
                                                               </a>
                                                           </dataitemtemplate>
                                                       </dx:gridviewdatabinaryimagecolumn>



Thanks
 
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