ASP button

Results 1 to 10 of 10

Thread: ASP button

  1. #1
    jeff q Guest

    Default ASP button

    Hi there,<BR>I am trying to stick to rule 1- depend less on interdev DTCs and do more real coding; and while doing so I have run into trouble. Does anyone have any code similar to the button DTC that can create a button from an image then do a simple response.redirect? I can&#039;t get it to work using html. <BR>Thanks in advance,<BR>Jeff

  2. #2
    helper Guest

    Default RE: ASP button

    You can create an &#060;img&#062; with an onclick event<BR>&#060;img src=".." onclick="Javascript:window.location.href=&#039;[URL]&#039;"&#062;<BR><BR>Response.redirect is a server side script not on the client that has to occur basically on load not as a result of a user event.<BR>

  3. #3
    jeff q Guest

    Default RE: ASP button-needs querystring value

    I am sorry I left out that it needs to get the querystring value before it can go to the next page so it knows where to go-e.g.<BR><BR><BR><BR>There are a bunch of values that need to go from one querystring into the next. Any way to do that?<BR>Thanks!

  4. #4
    Bill H. Guest

    Default try...

    &#060;form name=form1 action="whereever.asp" method="get"&#062;<BR>&#060;input type="image" src="images/image.gif" name="img1"&#062;<BR>&#060;input type="hidden" name="var" value="whatever"&#062;<BR>&#060;/form&#062;<BR><BR>makes the image work like a submit button...

  5. #5
    helper Guest

    Default RE: ASP button-needs querystring value

    &#060;img [...] onclick="window.locaiton.href=&#039;URL.asp?id=&#0 60;%=Request.querystring("id")&#039;"&#062;<BR><BR >Or call a function onclick and in the function build the querystring from values on the page and then do the event

  6. #6
    jeff q Guest

    Default RE: try...not a submit button

    The image doesn&#039;t submit submit button images are easy. That&#039;s the thing, I need a button similar to the button dtc that will take an image as it&#039;s source but on click it will run a sub such as:<BR><BR>Sub BtnImage_onclick<BR>ID=Request.Querystring("value" )<BR>Response.Redirect("wherever.asp?id=" & ID)<BR>End sub<BR><BR>How can I get this to work?

  7. #7
    jeff q Guest

    Default Thanks Helper! <eop>

    Worked like a charm!

  8. #8
    Bill H. Guest

    Default Well...

    I&#039;m sorry, but it looks like all your trying to do is get a value, append it to a string, and redirect. That&#039;s pretty much the same thing as a submit. Just do something like<BR><BR>ID = Request.QueryString("Value")<BR>%&#062;<BR>&#060;i nput type="hidden" name="ID" value="&#060;%=ID%&#062;"&#062;<BR><BR>Then submit the page using method="get" if you want, and you&#039;ll get the same function you&#039;re trying to do with an onclick event...unless all this HAS to be server side...

  9. #9
    Bill H. Guest

    Default hmmmm...

    Unless you have a submit somewhere else on the form and you don&#039;t want the form submitting to the same place you&#039;re redirecting this the case?

  10. #10
    jeff q Guest

    Default RE: hmmmm...

    Hi Bill,<BR>I am not using a form of any kind- it is a table full of information that is written by the script. I needed an image that on click would take the person to another page that had more specific information about a product by completing a request.querystring on the second page. I didn&#039;t know how to do this. I used helpers code and it worked fine, but re-using it on another page has been tricky because I can&#039;t get it to call a function onclick. It will be a long night!<BR>Thanks!<BR>Jeff

Posting Permissions

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