Set Session using Jquery and Webservice.............................

Unknown | 6:41 AM |

<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release">
            <Services>
                <asp:ServiceReference Path="~/DropdownWebService.asmx" />
            </Services>
        </asp:ScriptManager>



  <script type="text/javascript">
                function fungetFacilityId() {
                    var hdnFacilityID = document.getElementById('<%=ddFacility.ClientID %>').value;
                    $('#<%=hdnFacilityID.ClientID %>').val(hdnFacilityID);
                    HorvatCOS.DropdownWebService.get_lanefacilityId(hdnFacilityID);

                }          
 
            </script>





Imports System.Collections
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports System.Collections.Specialized
Imports AjaxControlToolkit
Imports System.Configuration
Imports System.Data

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
Public Class DropdownWebService
    Inherits System.Web.Services.WebService
 
 
    <WebMethod(EnableSession:=True)> _
    Public Function get_lanefacilityId(ByVal lanefacilityId As String)
        Session("lanefacilityId") = lanefacilityId
        Return lanefacilityId
    End Function


End Class

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....