Solved

pass data between websites asp.net

Posted on 2004-10-20
6
461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RegEx Help - open to other simple suggestions 8 63
Using Classic ASP inside HTML pages 2 70
Html form and modal / img src -problem 3 43
ASP exit 10 26
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

735 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