Click here to Skip to main content
15,886,023 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I have a Gridview and I am using the Base Admin Bootstrap HTML 5 theme from here Base Admin Bootstrap theme[^]

My Gridview code is as follows:

ASP.NET
<asp:GridView ID="grdVehicleList" OnRowCommand="grdVehicleList_RowCommand"  runat="server"
                    OnRowDeleting="grdVehicleList_RowDeleting"  CssClass="table table-striped table-bordered"  AutoGenerateColumns="False">
                    <Columns>
                        
                        <!-- Some Columns here -->

                        <asp:TemplateField HeaderText="Delete">
                            <ItemTemplate>                                
                                    <asp:LinkButton runat="server" ID="lnkDelete" Text="" CommandName="Delete"  CssClass="msgbox-confirm icon-remove"></asp:LinkButton>                                   
                            
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>


I have attached the confirm dialig box to the 'Delete' button. But the server side event
HTML
OnRowCommand="grdVehicleList_RowCommand"
is not fired when I select Yes from the confirm box.

The code for dialog in the jQuery file is as follows:

JavaScript
$('.msgbox-confirm').live ('click', function (e) {
		$.msgbox("Are you sure that you want to permanently delete the selected element?", {
		  type: "confirm",
		  buttons : [
		    {type: "submit", value: "Yes"},
		    {type: "submit", value: "No"},
		    {type: "cancel", value: "Cancel"}
		  ]
		}, function(result) {
		    $("#result2").text(result);		    
		});		
	});


I tried firing a
JavaScript
$("form").submit();
in the
JavaScript
function(result)
but still it does not postback.

Can somebody show me the directions?

Please feel free to ask any information needed to investigate the issue.

Thanks in advance...
Posted
Comments
thatraja 12-Dec-13 4:57am    
Got any error?(browser debugger or developer tools), check it out
bbirajdar 12-Dec-13 5:18am    
Dear thatraja. I am not getting any error. The Dialog box closes on click of Yes, No, Cancel button ( Yes. It has Yes, No and Cancel .. I am sure about it ) but does not postback on click of Yes button
TryAndSucceed 12-Dec-13 15:42pm    
May be this will help you: http://stackoverflow.com/questions/14932231/how-do-i-make-an-asp-net-postback-confirmation-dialog-with-jquery

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