CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Location
    Tennessee
    Posts
    19

    [RESOLVED] Adding onKeyPress programmatically

    I have web app using C# and ASP.Net. I want to add a onKeyPress programmatically to an textbox and when user is typing call a C# function to reset the session time out. I have tried in Javascript but it does not recognize Session.Timeout. Also I have added onKeyPress successfully but can not get the call to a C# routine right.

    Can this be done in C#?

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Adding onKeyPress programmatically

    C# would be used for server side coding. Session is also a server side object. Java Script is used for Client side coding so it has no access to the Session object. The problem is that you want to access a server side object from the client side which you can not do.
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured