Below code is not working:
var valBusType =$('#%=Label2_fromTo.ClientID %>').html();
Thank you all, for your reply. Here I am improving my question so that it can be more understandable and answerable.
I have these controls on my default.aspx page (in .net 3.5)
1:
<asp:DropDownList ID="DdlPickUpPoint" runat="server" CssClass="select" Width="300"></asp:DropDownList>
2:
<asp:TextBox ID="txtSeatNo" runat="server" CssClass="hideBorder" onKeyPress="return false"></asp:TextBox>
3:
<asp:Label ID="lblTotAmt" runat="server" ></asp:Label>
Now I want to get values of these controls in JScript.js using jquery and then pass it to webservice . Code is below
var valTotValue= =$('#<%=lblTotAmt.ClientID %>').val();
var valSeatNo= =$('#<%=txtSeatNo.ClientID %>').val();
var valPickupPoint =$('#<%=DdlPickUpPoint.ClientID %>').html();
debugger;
$.ajax(
{
type: "POST",
url: "WebService_SeatLayout.asmx/GetLayout
data:"{'strTotValue' : " + valTotValue + ",'strSeatNo': "+ valSeatNo + ",'valSeatNo' : " + valPickupPoint + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (msg)
{
alert(msg.d);
if(msg.d==true)
{
var url = 'CustInfo.aspx';
window.location.href = url;
}
},
error: function (x, e)
{
alert("The call to the server side failed. " + x.responseText);
}
}
);
return false;