Results 1 to 15 of 15

Thread: asp info

  1. #1

    Thread Starter
    Hyperactive Member DaveR's Avatar
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    268

    Question asp info

    Hi,

    i put this in this forum to maximise my chances of getting a reply.

    I have an ASP app., that is used with outlook folder home pages.
    When i select a folder the asp page is displayed.
    I have a client script that retrieves the name of the folder selected.

    I want to use the FolderName i have got here , for a database search.
    I am assuming i should use a Server Side script to do this.

    Is it possible to have a client and server script on the same page?
    Can I use a variable i have declared in the client script in the server script?

    Finally, my client script gets the outlook folder on the Window_Onload event. Does anyone have any idea of how i can use the result of this in a server side script to run after the cleint script??

    This probably makes no sense , but if anyone has even the faintest idea of what i'm on about , please let me know.
    Thanks
    DaveR

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Is it possible to have a client and server script on the same page?

    No

    Can I use a variable i have declared in the client script in the server script?

    Yes

    Well That one was simple, next ...


    Oh, okay, you want a bit more on this ?

    1st one kinda takes away the whole server / client concept, you either write a server or a client asp page depending where it's going. Just split your code into 2 pages.

    2nd one I could write a book on. Basically, look at RESPONSE and REQUEST in the help files.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    okay, VERY basic this, but ...

    A response page SENDS the information. EG - a Client side web page form - loadsa textboxes to fill out kinda thing.

    The request page (server side) picks this up & does all the processing to it, EG, taking the textbox information passed to it and placing all this into a database.

    1 way of passing info from response to request is to use a hyperlink :
    Code:
    <A Href=MySecondASPpage.asp?VariableName=hello>
    Where, after the Href link, you can place a question mark and pass in parameters to the second page (these parameters are called QUERYSTRINGS).

    The other is to use a form :
    Code:
    <form Name="frmASPpage1" method="post" Action="frmASPpage2">
    You put form tags <FORM> and </FORM> just inside of the <BODY> tags. You need the method as post (as above) so this page sends information to the serverside request page, and the action property is where you say which page to send it to.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    That probably didn't make much sense, but in MSDN, look up :
    RESPONSE
    REQUEST
    QUERYSTRING
    Attached Files Attached Files

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5
    Lively Member
    Join Date
    Jun 2001
    Posts
    72
    I actually thought that you code have client and vb script for the one asp page, what about Java(Client) and vbscript(server)
    TH

  6. #6

    Thread Starter
    Hyperactive Member DaveR's Avatar
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    268
    I kind of understand what you are saying.
    The way i see it is:

    a) A user logs on to the asp page.The web server sends down a html page to the users browser.The client script inside the html page is executed.(This gets my FolderName)

    From what i know about ASP this is what happens.

    b)I need to use the FolderName got in (a) to do my database query.This needs to be ran on the server from a performance point of view.This requires a server script.

    I cant have both on the same page , so i need to use 2 pages and pass the variable into the second page .

    The thing is i dont want the user to know there are 2 pages.I just want them to see the database query results.

    *Is there any way i can ( within my client asp page) call the next asp page without the user knowing??

    I'm using interdev to build them.
    My head is wrecked with this ASP concept , so if you have any more ideas let me know.

    Thanks again
    DaveR

  7. #7
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Glad your using interdev, that's what I got.

    Yeah, the concepts right :
    1) Server generates 1st page, sends it to client.
    2) This becomes Client side page & the server hdiscards it - has nothing to do with it any more - sent-bosh-job done-Next
    3) The user sends an instance of the page back to the server. All the pages variables are kept & can be referenced.
    4) The server picks up the page, and calls the linked / related asp page
    5) your asp page can then take the parameters and pass these as an SQL string.

    I actually thought that you code have client and vb script for the one asp page, what about Java(Client) and vbscript(server)
    I've not heard of this, not ruling it out, but this doesn't really make any sense if it was possible.
    Java's used on the client for non-MS browsers, as only IE supports VBscript. Java's universal - all browsers support this.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  8. #8
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    The thing is i dont want the user to know there are 2 pages.I just want them to see the database query results.
    As far as the user's concerned, there is only 1 page.
    All of the processing is done, then you use the RESPONSE.WRITE statement to pass back the server processed data into the client side page.

    Attached is an interdev project that'll hopefully explain this when you run it.

    Basically, the first page closes when it's sent, and the second's displayed on the screen where the first is.

    In the sample, I've put "Some text on the page" on both the client and the server page, this can be icons, paragraps, pictures etc. Basically, you design both the client and the server the same - same layout, pictures etc APART FROM what you're changing, that way, when the client closes & the server processed instance of the page is loaded, they look more or less the same & the user won't be able to tell it's a new one.

    With the sample, create a new interdev project, then copy & import these files. the asp page needs to go into a new folder called scripts.
    Attached Files Attached Files

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  9. #9

    Thread Starter
    Hyperactive Member DaveR's Avatar
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    268
    Alex ,

    Your a life saver , cheers.


    David
    DaveR

  10. #10

    Thread Starter
    Hyperactive Member DaveR's Avatar
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    268
    I spoke too soon.
    Final question.

    On my html page i have a small client script to get the current outlook folder open and this is run on Window_Onload()

    Sub window_onload()
    dim objFolderName,Name1
    set objFolderName = CreateObject("GetFolderName.GetFolder")
    Name1 = objFolderName.GetFolderName
    msgbox Name1 --**
    set objFolderName = nothing
    End Sub

    Question is how can i get the variable Name1 to be sent back to Page 2.
    How can I assign it to a text box text , so it could go back the way you have it set up with the form post method.??

    This is the last question for definite.
    Cheers
    DaveR

  11. #11
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Keep on asking, I don't mind, though I can't answer until tomorrow morning now.

    You can call on the variable names as you would a text box :
    Code:
    RESPONSE("Name1")
    Well I would set up a textbox on the server / request page, then set it's value like this :
    Code:
    <INPUT type="Text" Name="TxtRequestPage1" Value=Response("Name1")>
    I'm pretty sure this should do it.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  12. #12

    Thread Starter
    Hyperactive Member DaveR's Avatar
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    268
    Alex,
    find enclosed an ASP page .
    The variable Name1 is got in the Window_Onload event.

    I just cant figure out how to get Name1 into the code for sending the textbox text back to the server.

    It doesnt seem to be recognised outside the window_onload event.

    My plan was to put Name1 into the text box text and make the textbox invisible , and hitting the sub-mit button should display page 2 with database info.

    Can you have a look at the page enclosed . if you can figure out any way of getting variable Name1 back to the server.

    Cheers.
    Dave
    DaveR

  13. #13

    Thread Starter
    Hyperactive Member DaveR's Avatar
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    268
    Alex,
    find enclosed an ASP page .
    The variable Name1 is got in the Window_Onload event.

    I just cant figure out how to get Name1 into the code for sending the textbox text back to the server.

    It doesnt seem to be recognised outside the window_onload event.

    My plan was to put Name1 into the text box text and make the textbox invisible , and hitting the sub-mit button should display page 2 with database info.

    Can you have a look at the page enclosed . if you can figure out any way of getting variable Name1 back to the server.

    Cheers.
    Dave
    Attached Files Attached Files
    DaveR

  14. #14
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Good Point

    I've never done that, I just thought it was possible. After looking at it, your right, I can't work out how to pass parameters in like this damn.

    This'll be useful, so I'm going to see if I can find this over the next few days / weeks. If I carack it, I'll post here.

    Your alternative would be to pass this variable in as a parameter in a querystring I mentioned earlier. I guess there must be a way to pass it when submitting the form, but I'm gonna need some time on this.

    Cheers,
    Alex

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  15. #15
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    http://support.microsoft.com/support.../Q300/1/04.ASP

    Might help you too. To pass the parameters in using a submit rather than a hyperlink, you'll have to cheat !

    Use a standard button :
    Code:
    <Input type="button" name="cmdSubmit" Onclick="SubmitThisPage">
    Rather than using a standard submit button & letting it automatically send the page.

    Normally, the Javascript for sending a page is just :
    Code:
    function SubmitThisPage();
    {
        submit();
        return;
    }
    In this case, for the parameters, you should be able to use the response.redirect, so treating the command button as a hyperlink :
    Code:
    function SubmitThisPage();
    {
        response.redirect secondpage?parameter=somevalue
        return;
    }
    Cheers !

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width