Urgent Help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Urgent Help

  1. #1
    Paul Guest

    Urgent Help


    Hi all,

    i have a small problem and i donno how to pass a value from asp code to javascript
    code and from javascript code to asp code ...

    i have a asp form ... on body load i need it to be directed to another form
    called "Style.asp" wich need a value called step.

    so i tried this code and i got always "StepCode" the value of step, meanwhile
    the value returned by <%Request.QueryString("step")%> could be "p" or "g"

    so any help or suggestion ???

    thx in advance


    <script language="Javascript">
    function refreshFrame(StepCode) {
    window.parent.frmStyle.location.href='Style.asp?step="StepCode"';
    window.open;

    return true;
    }

    </script>

    <body onload="return refreshFrame('<%Request.QueryString("step")%>');">


    Paul



  2. #2
    Kris Eiben Guest

    Re: Urgent Help

    It's right in front of you...
    >window.parent.frmStyle.location.href='Style.asp?step="StepCode"';
    >the value returned by <%Request.QueryString("step")%> could be "p" or "g"


    Combine the two, and you get:
    window.parent.frmStyle.location.href='Style.asp?step=<%=Request.QueryString(
    "step")%>;

    Also, this line:
    ><body onload="return refreshFrame('<%Request.QueryString("step")%>');">

    Should read
    <body onload="return refreshFrame('<%=Request.QueryString("step")%>');">
    Note the '='.

    Paul wrote in message <3abf0045$1@news.devx.com>...
    >
    >Hi all,
    >
    >i have a small problem and i donno how to pass a value from asp code to

    javascript
    >code and from javascript code to asp code ...
    >
    >i have a asp form ... on body load i need it to be directed to another form
    >called "Style.asp" wich need a value called step.
    >
    >so i tried this code and i got always "StepCode" the value of step,

    meanwhile
    >the value returned by <%Request.QueryString("step")%> could be "p" or "g"
    >
    >so any help or suggestion ???
    >
    >thx in advance
    >
    >
    ><script language="Javascript">
    >function refreshFrame(StepCode) {
    >window.parent.frmStyle.location.href='Style.asp?step="StepCode"';
    >window.open;
    >
    > return true;
    >}
    ></script>
    ><body onload="return refreshFrame('<%Request.QueryString("step")%>');">




  3. #3
    Devin Knutson Guest

    Re: Urgent Help

    "Paul" <paul@namtek.ca> wrote in message news:3abf0045$1@news.devx.com...
    > i have a small problem and i donno how to pass a value from asp code to

    javascript
    > code and from javascript code to asp code ...


    Hi Paul.

    JavaScript can access variables which were created in asp, but not the other
    way around. Because asp runs on the server, and JavaScript on the client,
    the JavaScript will have access to any asp on the page, but the asp on the
    page will already be done executing when the JavaScript runs. To pass
    variables from JavaScript back to the ASP, you'll have to send the request
    back to the server.

    i.e:
    ------------------------------
    <%
    intBoink = Request("boink")
    %>

    <SCRIPT LANGUAGE="JavaScript">
    function checkboink(valBoink)
    {
    if (valBoink < 1)
    {location.replace('Boink.asp?LessThan1=true')}
    }
    </SCRIPT>

    <BODY onLoad="checkboink(<%=intBoink%>)">
    ------------------------------

    I hope that makes sense.

    --
    Devin
    Senior Developer
    WebNW, LLC
    http://www.mp3.com/DevinK
    _______________________________________________________
    Look on the bright side... After the next four years,
    we'll probably never have to deal with another Republican
    President in our lifetime.



  4. #4
    manoj Guest

    Re: Urgent Help


    hi
    i need the source code to get the file content in to a textarea using javascript
    can u pls help me out as soon as possible
    thanking u
    manoj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center