Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. window open

window open

Scheduled Pinned Locked Moved ASP.NET
csharpcomtutorialquestionworkspace
7 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dcof
    wrote on last edited by
    #1

    I am trying to have a C# 2010 web form call another web page using a response.redirect and that is not working. I am wondering if I can setup a

    window.open('~/www.site.com'); return false;

    to have a web form page point to the correct webpage I am looking for. Can you tell me how to accomplish this goal by using a window.open statement?

    C J 2 Replies Last reply
    0
    • D dcof

      I am trying to have a C# 2010 web form call another web page using a response.redirect and that is not working. I am wondering if I can setup a

      window.open('~/www.site.com'); return false;

      to have a web form page point to the correct webpage I am looking for. Can you tell me how to accomplish this goal by using a window.open statement?

      C Offline
      C Offline
      CodeHawkz
      wrote on last edited by
      #2

      Your question is vague. We cannot help you unless you mention the specifics. What do you want to do? Do you want to redirect user to another page when the user clicks on a link? Or do you want to post data to another page? Or do you want to post data to server and redirect the user based on the response you get?

      D 1 Reply Last reply
      0
      • C CodeHawkz

        Your question is vague. We cannot help you unless you mention the specifics. What do you want to do? Do you want to redirect user to another page when the user clicks on a link? Or do you want to post data to another page? Or do you want to post data to server and redirect the user based on the response you get?

        D Offline
        D Offline
        dcof
        wrote on last edited by
        #3

        I want to post data to another page and return to the same spot I was at. When I return to my original page, I want to update the data as what was happening before.

        C 1 Reply Last reply
        0
        • D dcof

          I am trying to have a C# 2010 web form call another web page using a response.redirect and that is not working. I am wondering if I can setup a

          window.open('~/www.site.com'); return false;

          to have a web form page point to the correct webpage I am looking for. Can you tell me how to accomplish this goal by using a window.open statement?

          J Offline
          J Offline
          jkirkerx
          wrote on last edited by
          #4

          window.open('http://www.site.com'); return false; if you want to open a popup to another website [EDIT] you can't post data to another page in this manner. Usually in this case, it's a credit card form, in which you get an api, and you populate your page with the textboxs, and then post to another page. The next page will consume the data, and send you back to the original page.

          It's really not an asp.net issue, and just basic html, unless your using code behind to alter the form tag, or doing something fancy.

          D 1 Reply Last reply
          0
          • J jkirkerx

            window.open('http://www.site.com'); return false; if you want to open a popup to another website [EDIT] you can't post data to another page in this manner. Usually in this case, it's a credit card form, in which you get an api, and you populate your page with the textboxs, and then post to another page. The next page will consume the data, and send you back to the original page.

            It's really not an asp.net issue, and just basic html, unless your using code behind to alter the form tag, or doing something fancy.

            D Offline
            D Offline
            dcof
            wrote on last edited by
            #5

            Does the

            window.open('http://www.site.com'); return false;

            only work in javascript? I am asking that question since I cannot get this to work in C#. Can you also show me how to code the window open in a popup window? Thans!

            J 1 Reply Last reply
            0
            • D dcof

              Does the

              window.open('http://www.site.com'); return false;

              only work in javascript? I am asking that question since I cannot get this to work in C#. Can you also show me how to code the window open in a popup window? Thans!

              J Offline
              J Offline
              jkirkerx
              wrote on last edited by
              #6

              That's Javascript, doesnt' matter if it's c# or VB, Javascript runs on the client, and not the server.

              dcof wrote:

              Can you also show me how to code the window open in a popup window?
              Thans!

              Your looking at it, in the last post and below, it open another browser instance or tab to the website you call.

              window.open('http://www.site.com'); return false;

              But you said you wanted to post data to another website, Javascript won't do that It's the Form tag http://www.w3schools.com/html/html_forms.asp[w3schools - Form Tag^] [MSDN Form Tag^]

              1 Reply Last reply
              0
              • D dcof

                I want to post data to another page and return to the same spot I was at. When I return to my original page, I want to update the data as what was happening before.

                C Offline
                C Offline
                CodeHawkz
                wrote on last edited by
                #7

                There are 2 ways that you can achieve this. 1. Use a Ajax call to the other page and based on the result you get, you can update the current page. This is the easiest way. 2. Use a normal postback to the server, to the other page. While you do that, post the current URL as a parameter too. So in the other page, perform your logic, redirect to the passed URL and use session (recommended) or viewstate or some data store to send the values that you want to update the other page :) Hope this helps and makes sense Regards

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups