Link to home
Start Free TrialLog in
Avatar of GlobaLevel
GlobaLevelFlag for United States of America

asked on

asp.net - call a sub on the server side...even though its shared...


 How can I call a
------

   <WebMethod()> _
    Public Shared Sub SetVariable(ByVal textVal As String,)
        HttpContext.Current.Session("SessionUserFirstName") = textVal
   
        call_this_sub(textVal)

    End Sub
Avatar of GlobaLevel
GlobaLevel
Flag of United States of America image

ASKER

this isnt working;

 HttpContext.Current.Application(do_this(textVal))
Try creating a new instance of your class that contains the above webmethod and call the sub..

dim myClass as New WebMethodClass
myClass.do_this(textVal)

Pra4444....

thats not working for me...


Imports System.Data.SqlClient

Imports System.IO
Imports System.Data.SqlClient.SqlDataAdapter
Imports System.Data.SqlClient.SqlConnection
Imports System.String
Imports System.StringComparison
Imports System.Text.StringBuilder
Imports System.Web.UI
Imports System.Web.UI.Page
Imports System.Web.UI.WebControls.TextBox
Imports System.Web.UI.WebControls
Imports System.Web.UI.ExtenderControl
Imports System.Random
Imports System.DateTime
Imports System.Data.OleDb
Imports System.Text
Imports System.Data.Odbc
Imports System.Data
Imports System.Text.RegularExpressions
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Services
Imports System.Web.SessionState.HttpSessionState


Partial Class client_online_srvnt
    Inherits System.Web.UI.Page



    <WebMethod()> _
    Public Shared Sub SetVariable(ByVal textVal As String)
        HttpContext.Current.Session("SessionUserFirstName") = textVal
        ' do_this(textval)
        dim myClass as New WebMethodClass
        MyClass.do_this(textVal)


    End Sub

    Public Sub do_this(ByVal textvlas As String)



    End Sub

End Class

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Pra4444
Pra4444
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial