Solved

pass data between websites asp.net

Posted on 2004-10-20
6
457 Views
Last Modified: 2012-06-21
Hi,
I am using asp.net. I wanted to pass data from form fields. I have a file Webform1.aspx and its corresponding c# file Webform1.aspx.cs

In Webform1.aspx.cs i have
------------------------------------------------------------------------------------

            public void Button1_Click(object sender, System.EventArgs e)
            {
                  Server.Transfer("WebForm2.aspx");
            }

            public void Button2_Click(object sender, System.EventArgs e)
            {
                  
                  Response.Redirect("http://peacock.com/asp-scripts/data_test.asp?TextBox1=" + TextBox1.Text,true);
            
                  
            }
      
--------------------------------------------------------------------------------------------------
well in the method button2_click(...) i use the response.redirect method to call the webpage on some other website.As u can i pass fields as  querystring.

I was wondering if there is a way so that i  dont have create a querystring and post the form. u know something like
Response.Redirect("http://peacock.com/asp-scripts/data_test.asp",true); and still have the form fields post onto the target website's webpage.

BTW i can't get Server.Transfer(..) method to call a webpage on some other website.
Lemme know if u need more info

Thanks in advance
Rajiv.
0
Comment
Question by:rajiv11
  • 2
6 Comments
 
LVL 26

Accepted Solution

by:
Rejojohny earned 25 total points
ID: 12367595
u could do a redirect from the client-side using "document.location.href" instead of the "redirect" statement from code-behind . this client-side function could be called by window_onload .. so basically all ur controls would be created and values would be accessible from the redirected page using the standard "request.form" method ...
0
 
LVL 7

Assisted Solution

by:mantarae
mantarae earned 25 total points
ID: 12372713
we handled this situation with JavaScript.

we added a function:

function PostToPage( f, loc ){
      f.__VIEWSTATE.name = '';  //viewstate was screwing up the post, cause it was really long
      f.action = loc;
      f.submit();
}


then in our button, we added this code:

onclick="PostToPage( document.forms[0], 'http://peacock.com/asp-scripts/data_test.asp' );"
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12746936
Please do have a look at my comments .. it will work ...
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now