www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > .NET

    .NET Discussion and technical support for, building, using and deploying .NET sites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 06-06-2007, 04:14 AM
    Sangramss Sangramss is offline
    Registered User
     
    Join Date: Apr 2007
    Posts: 4
    Calling javascript function from code behind

    Hi,

    I have a web page created in asp.net app (VB). I want to show a
    alert box after doing some validations. And I also want to
    do some more codebehing process after .
    Is it possible to call a Javascript function through Codebehind.


    Thanks,
    Sangram
    Reply With Quote
      #2  
    Old 06-08-2007, 01:17 AM
    niconel.com niconel.com is offline
    niconel.com
     
    Join Date: May 2007
    Location: Beijing - China
    Posts: 49
    use the Page.RegisterStartupScript method

    Declare a string, build up a valid javascript statement, and then pass it as parameter to this method.

    sht like this (typing from top of my head, so....)

    Code:
    Dim x as string = "<script language='JavaScript'> alert('visit www.niconel.com') </script>"
    Me.RegisterStartupScript("Startup", scriptString)
    There's another one......uurgh, name escape me now, but this will work.

    please research and test it...i did not use vb in ages
    __________________
    niconel.com
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:39 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.