Click here to Skip to main content
15,943,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,
I was trying to fetch the data from dataset and display in DIV tag using JQuery using ajax.

Any idea how to do it?

Thanks in advance
Posted
Comments
dhage.prashant01 5-Jun-11 3:51am    
Do dataset should be converted to jason object, to access using jquery?

1 solution

hi,

better to use Ajax popup extender simple and very use full


XML
<div>
    <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
    <cc1:ModalPopupExtender ID="MPE" runat="server" CancelControlID="btnCancel"
    TargetControlID="HiddenField1" PopupControlID="MessageDiv" BackgroundCssClass="popupbg">
     </cc1:ModalPopupExtender>
<asp:HiddenField ID="HiddenField1" runat="server" />
<div runat="server" id="MessageDiv" style="width: 450px;display: none;">
<asp:Label ID="lblMsg" runat="server"></asp:Label><br />
<asp:Button ID="btnOK" runat="server" Text="Ok" OnClick="btnOK_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />

    </div>
    </div>



in any button click or when you want to shoe this popup

MIDL
lblMsg.Text = "You will Never  shutdown the real napster";
            MPE.Show();


this will help use ajax control tool kit
 
Share this answer
 
v2
Comments
dhage.prashant01 4-Jun-11 6:50am    
Problem is ModalPopUp freeze the screen, it disturbs the user.
What I'm trying to do, when user clicks the button div gets displayed at bottom of page which will show the required data. It wont freeze screen and user can manually close the popup div.
Any idea how to populate div with JQuery?
I have tried using ajax, trying to call webservice from where I get the data. Problem how to loop the datatable and display records in DIV tag
dhage.prashant01 4-Jun-11 6:56am    
This is what i have tried, but outputs error
$.ajax({
type: "Post",
url: "WIPCommentsNotification.aspx/getWIPComments",
data: "{}",
dataType: "jason",
contentType: "application/json; charset=utf-8",
success: function(data) {
var acc = $('#modalbody').empty();
acc.append($("<table>"));
$(data.d).each(function() {
acc.append($("<tr>"));
acc.append($("<td>")).html(this.jobno);
acc.append($("</td>"));
acc.append($("</tr>"));
acc.append($("<tr>"));
acc.append($("<td>")).html(this.commenttext);
acc.append($("</td>"));
acc.append($("</tr>"));
});
acc.append($("</table>"));
},
error: function(XMLHttpRequest, textStatus, errorThrown) { debugger; }
});

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