1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Copying a javascript variable to an ASP.NET/VB.NET variable

Discussion in 'C#' started by LittlBUGer, May 16, 2008.

  1. #1
    Hello. I have a problem that I think I'm just missing the bleeding obvious on. I'm not at all proficient or very familiar with javascript, but I can code in ASP.NET, VB.NET and whatnot all day long. Recently I've built a web tool which uses Microsoft Virtual Earth and such. I have some variables in javascript (as that's how you create the map and such with VE) that I need to pass to some ASP.NET variable or control... any kind as long as it works. I can't seem to find any way to properly do this. It seems that it's easy going from ASP.NET to javascript, but not the other way around. Does anyone have any good working suggestions for this? I'm using .NET 2.0. Thanks.
     
    LittlBUGer, May 16, 2008 IP
  2. fhirzall

    fhirzall Guest

    Messages:
    124
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can put a hidden field on your aspx page, find it in your javascript and set the value, then get the values on postback in your codebehind. If you have multiple values just comma seperate them and split them on the server.

    You could use AJAX to pass the values to the server.
     
    fhirzall, May 16, 2008 IP
  3. LittlBUGer

    LittlBUGer Peon

    Messages:
    306
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I wish it were that simple but it's not. Everything I've tried has failed and I don't have much more time to work on this. Any help with actual code would be greatly appreciated. Thanks.
     
    LittlBUGer, May 16, 2008 IP
  4. TasteOfPower

    TasteOfPower Peon

    Messages:
    572
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    it is this simple.
     
    TasteOfPower, May 28, 2008 IP