how to show return message on label

I have a jq grid where in that i have a drop-down with two options when ever i select anything and click on enter it should show a message in a label that data is updated.

The logic is already handling in ashx handler.

Ashx handler code

public void ProcessRequest(HttpContext context)
{
HttpRequest request = context.Request;
HttpResponse response = context.Response;

System.Collections.Specialized.NameValueCollection forms = context.Request.Form;
string strOperation = forms.Get("oper");

}

In the update method -- 

if (forms["oper"].ToString() == "edit")

{
returnvalue = "Record Updated successfully";

}

Now we need to pass this return value to aspx page when ever record is updated..

In aspx page

<asp:Label ID="lblMessage" runat="server" ForeColor="##"></asp:Label>

function onEnterrowdetails() {
$('#<%=lblMessage.ClientID%>').html("Data Updated......");
return true;
}

but not getting message..any help plz how to pass the return value to this page?

I used .text() property still its not showing do we need to make any changes?

$('#<%=lblMessage.ClientID%>').text("Data Updated......");

Hi mcfarlandparkway,

Thanks for your post.

As for your problem, you could refer to the following links which will show you some similar issues and possible solutions.

Hope it will be helpful to you.

Best Regards,

Fei Han

duplicate message posted twice

Thank you Fei Han for response.

I am trying to use this code in one of links which you provided

var myEditOptions = {
        keys: true,
        oneditfunc: function (rowid) {
            alert("row with rowid=" + rowid + " is editing.");
        },
        aftersavefunc: function (rowid, response, options) {
            alert("row with rowid=" + rowid + " is successfuly modified.");
        }
    };

$('#list1').jqGrid('inlineNav','#pager1', {
    addtext: "Add",
    edittext: "Edit",
    savetext: "Save",
    canceltext: "Cancel",                       
    addParams: { 
        position: "afterSelected",
        addRowParams: myEditOptions
    },
    addedrow: "last",
    editParams: myEditOptions
});

The below is my aspx code where should i keep the above code in my page

<script type="text/javascript">
        $(function() {
 $("#list").jqGrid({
                url: 'Handler.ashx',
                datatype: 'json',
                height: 250,
                colNames:bla bla...
colmodel ------
 caseSensitive: false,
                rownumbers: true,
                reloadAfterSubmit: true,
                width: 1024,
             
                gridComplete: function() {
                    
                    },
        jsonReader: {
                    repeatitems: false
                },
                caption: '-------',
                editurl: 'Handler.ashx',
          onSelectRow: function(id) {
});

 $("#list").jqGrid('navGrid', '#pager',
                        {
                            edit: false,
                            add: false,
                            del: false,
                            search: true,
                            searchtext: "Search",
                            reloadAfterSubmit: true,
                            cloneToTop: true,
                            overlay: false,
                            beforeRefresh: function() {
                                $("#list").setGridParam({ datatype: 'json', page: 1 }).trigger('reloadGrid');
                              
                            },
 $("#list").jqGrid('editRow', {

                aftersavefunc: function() {
                    onEnterrowdetails('#list');

                }


            });
 function onEnterrowdetails() {
            $('#<%=lblMessage.ClientID%>').text("data update");
            return true;
        }

Any help…

Leave a Reply