Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0javascript pop up on deletejavascript pop up on delete
Previous
 
Next
New Post
11/12/2007 1:41 AM
 

hello all,

I have a datagrid which is displayed in my module.It has both edit and delete columns.I need to know how can i get a pop up and fire the event parallely.i Am attaching the code

 

<asp:datagrid id=lstCompetencies AutoGenerateColumns="false" width="100%" DataKeyField="CompetencyId"CellPadding="4" GridLines="Both" cssclass="DataGrid_Container" Runat="server" BackColor="white">

 

<columns>

 

<dnn:textcolumn datafield="CompetencyName" headertext="Competency" />

 

<dnn:textcolumn datafield="CatogeryName" headertext="Catogery"/>

 

<dnn:textcolumn datafield="StatusName" headertext="Status"/>

 

<asp:TemplateColumn HeaderText="Edit">

 

<itemtemplate>

 

<asp:HyperLink id="EditCompetency" ImageUrl="~/images/edit.gif" NavigateUrl='<%# EditURL("CompetencyId",DataBinder.Eval(Container.DataItem,"CompetencyId"),"EditCompetency") %>' Visible="<%# IsEditable %>" runat="server" />

 

</ItemTemplate>

 

</asp:TemplateColumn>

 

<asp:TemplateColumn HeaderText="Delete">

 

<itemtemplate>

 

<asp:ImageButton ID="btnDelete" CommandName="Delete" ImageUrl="~/images/delete.gif" runat="server" />

 

</ItemTemplate>

 

</asp:TemplateColumn>

 

 

</Columns></asp:datagrid>

the back end code is like

 

 

Protected Sub Delete_Competency(ByVal sender As Object, ByVal e As

DataGridCommandEventArgs)

 

 

Dim CompetencyId As

Integer

CompetencyId = lstCompetencies.DataKeys.Item(e.Item.ItemIndex)

 

 

If Not Null.IsNull(CompetencyId)

Then

 

 

Dim objCompetencies As New

CompetencyInfo

objCompetencies.CompetencyId = CompetencyId

objCompetencies.ModuleId = ModuleId

CompetencyController.Competency_Delete(objCompetencies)

 

 

End

If

when the delete button is clciked the event fires but no pop up is being displayed

so i wrote another piece of code

 

 

 

 

myDeleteButton = e.Item.FindControl(

myDeleteButton.Attributes.Add(

 

Protected Sub lstCompetencies_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles lstCompetencies.ItemCreatedSelect Case e.Item.ItemTypeCase ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditItemDim myDeleteButton As ImageButton"btnDelete")"onclick", "return confirm('Are you sure you want to delete this Item?');")End Select

 

End Sub

 

 

 

 

 

 

which displays pop up.from this how can i call the above delete method when ok is clicked on the confirmation box.please help me in this regard.its urgent or please provide the code to do it in a correct way

thanks in advance

Sandeep.M

 

 
New Post
11/12/2007 12:03 PM
 

You might try using a custom validator control w/ a client-side script... validator controls are designed to prevent post-back based on some input... ie javascript confirm()

 
New Post
11/12/2007 1:48 PM
 

Take care of it on your page side...

<asp:ImageButton ID="btnDelete" CommandName="Delete" ImageUrl="~/images/delete.gif" runat="server" /> 

change to

<asp:ImageButton ID="btnDelete" CommandName="Delete" ImageUrl="~/images/delete.gif" OnClientClick="return confirm('Are you sure you want to delete this record?');"  runat="server" />

Chas

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0javascript pop up on deletejavascript pop up on delete


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out