/    Sign up×
Community /Pin to ProfileBookmark

Call Asp Sub Procedure in Javascript

Hi,

Im not sure if it is possible to call an ASP sub procedure in javascript, but i know vice versa is possible. Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@UbikDec 16.2005 — What you are asking is not really possible without contacting the server again, because asp is server side, and javascript is client side.

What are you trying to accomplish?

I mean, you could just have the javascript load the asp page with the functions you want.
Copy linkTweet thisAlerts:
@shaoen01authorDec 17.2005 — Hi,

Thanks for your reply. Well, i am currently working on a user control (.ascx) file in Asp.net. What i want to do is to create an image list box using <div> tags to expand and collaspe whenever user clicks on the "more" or "close" link/button.

The above i have already settled it, the only problem i have now is to allow user to select image and display the selected image upon clicking. Which means i must have a postback to ensure that the selected image is updated and to display other images besides the selected image displayed, when user expand the <div> tags.

My user control is something like a dropdownlist, but instead of text able to display images. Currently, I am using server-side coding to generate the images. It is dynamic because it will create the number of <img> tags according to how many image files i have in the provided directory of folder.

What do you suggest i should do to go around this problem?
Copy linkTweet thisAlerts:
@UbikDec 19.2005 — Seems like you have two options:

  • 1. load all of the possible images, and just display the one selected, using javascript, and hidden divs or


  • 2. Have an 'onChange load('imagespage.asp') which just loads page with the one image selected.


  • The pros and cons are:

  • 1. The cons is that Load times will be really bad, and bandwidth will be wasted, depending on how many images you have. The pro is that you will not need to make a round-trip to the server once the image is selected.


  • 2. The pro is that you will not waste any bandwidth, but you will be making a round trip to the server and reloading the page again with the new image.


  • You may be able to hack your way through some AJAX to get the best of both worlds, however.

    Good Luck.
    Copy linkTweet thisAlerts:
    @shaoen01authorDec 19.2005 — Thanks for letting me the options available. I will find out more information about AJAX as well. ?
    ×

    Success!

    Help @shaoen01 spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...