Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

pass data between websites asp.net

Posted on 2004-10-20
6
Medium Priority
?
466 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 100 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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

885 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