What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 1115 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > how can i set label value within ASP.Net DataList using jquery ...
Abhijit.Barua

how can i set label value within ASP.Net DataList using jquery

Replies: 3 | Posted by: Abhijit.Barua on 6/23/2012 | Category: ASP.NET Forums | Views: 1274 | Status: [Member] | Points: 10  


how can i set label value within ASP.Net DataList using jquery. plz help me.

thank you


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Sheonarayan
Sheonarayan  
Posted on: 6/23/2012 2:32:11 AM
Level: HonoraryPlatinum | Status: [Microsoft_MVP] [Administrator] | Points: 25

Have a specific class for the asp:Label (this class may not be declared in the CSS). Use jQuery CSS selector and specify its text.

Something like

$(".myClass").text("Something");


Hope this helps.

Thanks

Regards,
Sheo Narayan, Microsoft MVP
The Founder
http://www.dotnetfunda.com

Abhijit.Barua, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Abhijit.Barua
Abhijit.Barua  
Posted on: 6/23/2012 4:37:45 AM
Level: Starter | Status: [Member] | Points: 25

thank you sir,

i was try like this...i got data at json & at general asp.net control it's bind also but in case of datalist(label within datalist) i not able to do it.

my code...
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<%-- <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>--%>
<script type="text/javascript">
$(document).ready(function () {
$("#getData").click(function () {
// var table = $("#tableID").show();
// table.find("tr+tr").remove();
$.ajax({
url: "WebService.asmx/GetStudents",
data: "{}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
$(data.d).each(function (index, item) {


$("[id*=Label3]").eq(0).text(item.Id);
$("[id*=Label4]").eq(1).text(item.name);
for (var i = 0; i < data.d.length; i++) {
//here set vale for label within datalist


};

});
},
error: function (a, b, c) {
}
});
});
});
</script>

plz help me.

Abhijit.Barua, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Abhijit.Barua
Abhijit.Barua  
Posted on: 6/25/2012 3:57:27 AM
Level: Starter | Status: [Member] | Points: 25

sir, how i have to write the css class for label(or what i have to write) plz help me.

Abhijit.Barua, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 9:16:45 PM