Use aspx.vb Code to Javascript Code

Discussion in 'ASP .Net' started by laxmilal Menaria via DotNetMonster.com, May 12, 2005.

  1. Hello Every one,


    Can anybody please tell me how can I use values coming in my
    somepage.aspx.vb into somepage.aspx's Java Script's Code?

    What I need is that I am doing some page progress calculations in my
    webform's .vb code but i have to display those values on

    the .aspx of that same page.

    is there is any way to do that ?

    Please let me know if there is any alternative of doing that?


    Thanks

    --
    Message posted via http://www.dotnetmonster.com
     
    laxmilal Menaria via DotNetMonster.com, May 12, 2005
    #1
    1. Advertising

  2. laxmilal Menaria via DotNetMonster.com

    Sambathraj Guest

    Hi,
    This can be done using ASP way. Declare public property in your class which
    exposes the required data. In Aspx page you can write like
    var myData = <%= dblProgressVal %>;
    Regards
    Sambathraj
    "laxmilal Menaria via DotNetMonster.com" <>
    wrote in message news:...
    > Hello Every one,
    >
    >
    > Can anybody please tell me how can I use values coming in my
    > somepage.aspx.vb into somepage.aspx's Java Script's Code?
    >
    > What I need is that I am doing some page progress calculations in my
    > webform's .vb code but i have to display those values on
    >
    > the .aspx of that same page.
    >
    > is there is any way to do that ?
    >
    > Please let me know if there is any alternative of doing that?
    >
    >
    > Thanks
    >
    > --
    > Message posted via http://www.dotnetmonster.com
     
    Sambathraj, May 12, 2005
    #2
    1. Advertising

  3. laxmilal Menaria via DotNetMonster.com

    Mona Guest

    Hi Laxmilal,

    You can use RegisterClientScriptBlock to set values to the variables in your page's javascript code.

    You can refer to following link for an example:

    [Page.RegisterClientScriptBlock Method]
    http://msdn.microsoft.com/library/d...UIPageClassRegisterClientScriptBlockTopic.asp

    You can use your own javascript instead and set the values of the variables there.

    HTH

    Mona[Grapecity]


    "laxmilal Menaria via DotNetMonster.com" <> wrote in message news:...
    > Hello Every one,
    >
    >
    > Can anybody please tell me how can I use values coming in my
    > somepage.aspx.vb into somepage.aspx's Java Script's Code?
    >
    > What I need is that I am doing some page progress calculations in my
    > webform's .vb code but i have to display those values on
    >
    > the .aspx of that same page.
    >
    > is there is any way to do that ?
    >
    > Please let me know if there is any alternative of doing that?
    >
    >
    > Thanks
    >
    > --
    > Message posted via http://www.dotnetmonster.com
     
    Mona, May 12, 2005
    #3
  4. Hi,

    I Use your Sample But Problem that <% ... %> is not running in <script>
    ....</script> .

    My Problem is :

    I am getting Some Values on Page Render Event of aspx.vb page, but i have
    displayed these values in javascript code of that same page, i have use
    javascript code for xmlhttprequest, so every time render the page see value
    on javascript

    Thanks

    --
    Message posted via http://www.dotnetmonster.com
     
    laxmilal Menaria via DotNetMonster.com, May 13, 2005
    #4
  5. Hi,

    I see you link but not solve my problem.

    My Problem is :

    I am getting Some Values on Page Render Event of aspx.vb page, but i have
    displayed these values in javascript code of that same page, i have use
    javascript code for xmlhttprequest, so every time render the page see value
    on javascript

    Thanks

    --
    Message posted via http://www.dotnetmonster.com
     
    laxmilal Menaria via DotNetMonster.com, May 13, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nic
    Replies:
    0
    Views:
    453
  2. Paolo Pignatelli
    Replies:
    6
    Views:
    2,232
    Paolo Pignatelli
    Feb 21, 2005
  3. John M
    Replies:
    1
    Views:
    1,292
    Kumar Reddi
    May 29, 2005
  4. Mr Flibble
    Replies:
    8
    Views:
    38,578
    Will Asrari
    May 23, 2006
  5. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,378
    Mirronelli
    Oct 22, 2005
Loading...

Share This Page