473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to transfer large data to one page to another page

Hai

I am creating one web application

i am using xml String with one containing xml Output to assign that temporary variable..

this my requirement

I want to transfer one xml file to another or Redirected web page

how to transfer xml file or large data to another page

i am using ViewState and Query String

i am using ViewState

but another page the viewstate value is nothing



please help how to transfer..

reply me..
Oct 18 '07 #1
2 2252
Complete post below...
Oct 18 '07 #2
I think you got wrong the idea of what the viewstate is for, The ViewState's purpose in life is to persist state across postbacks. and thats it.

So, to accomplish what you want to do, you have in my opinion 2 viable options:
  • Session Variables
  • Using Server.Transfer


Session Variables
A way to pass values across pages. you can store control values and access them in anoter webform. the problem with this is that if you store too much data in session, than it can be a real problem for your server.
Besides that you are the one that is in charge of cleaning session variables properly.

Ex(just an example you can adapt it to your needs):

Expand|Select|Wrap|Line Numbers
  1. Session["XMLSTRING"]  = xmlString;
  2. Response.Redirect("WebForm2.aspx");
On the page load of WebForm2.aspx(or anywhere else)
you can use that session variable:

Expand|Select|Wrap|Line Numbers
  1. string someOtherThing = Convert.ToString(Session["XMLSTRING"]);
Server.Transfer
Server.Transfer might be a bit more complex. you must expose values you want to other pages as properties of the page class.
So you need to add properties so you can acces them in another webform, i prefer this method since its more object oriented.

Ex:

this goes on the "WebForm1.aspx"

Expand|Select|Wrap|Line Numbers
  1. public string anyValue
  2. {
  3.                 get
  4.     {
  5.         return TextBox1.Text;
  6.     }
  7. }
  8.  
  9. void button_click(object sender, System.EventArgs e)
  10. {
  11.                 Server.Transfer("WebForm2.aspx")
  12. }
  13.  
On "WebForm2.aspx"
Expand|Select|Wrap|Line Numbers
  1. void page_load(object sender, System.EventArgs e)
  2. {
  3.       WebForm1 webform;
  4.       webform=(WebForm1)Context.Handler;
  5.       label1.Text = webform.anyValue
  6. }
Oct 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: StephenMcC | last post by:
Hi All, Got a quick query in relation to the Server.Transfer method available in IIS 5+/ASP. I've got an issue where I want to take a portion of an online app and extract this out into a web...
5
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
3
by: Manuel Lopez | last post by:
Hello, We have two applications that will reside on the same webserver. We want to be able to post from pages in App1 to to pages in App2. We need to pass sensible data, so we cannot use...
2
by: ndario | last post by:
i am trying to transfer a user to another page with Server.Transfer() but i am having a problem with sending query params like this Server.Transfer("newPage.aspx?param=value"); in the PageLoad...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
15
by: dee | last post by:
Hi, I'm curious why MS decided to have Transfer hide the target page's url invisible? Any guesses ? Thanks. Dee.
11
by: E.T. Grey | last post by:
Hi, I have an interesting problem. I have a (LARGE) set of historical data that I want to keep on a central server, as several separate files. I want a client process to be able to request the...
10
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
2
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi, I'm using Threads, and when I try to do Server.Transfer, I recieved an error. (child object does not exist...) My Code: Dim t As New Thread(AddressOf Hilo) Private Sub Hilo()...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.