• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

2 buttons, 1 is for redirecting 1 is for upload.

Hi;

I have 2 buttons, 1 is for redirecting 1 is for upload a file. Redirection to a page works fine but I don't know the most feasible way to load a txt/xml file content and when redirecting button is clicked, it should redirect with the contents of the file. Any feasible way for this?

Regards.
0
jazzIIIlove
Asked:
jazzIIIlove
  • 3
  • 2
1 Solution
 
Jitendra PatilSr.Software EngineerCommented:
hi ,

please check the link below.
5 ways to send data between Asp.Net PAges

Http Post may be of help to you.

hope this helps.
0
 
jazzIIIloveAuthor Commented:
Thanks but it's not specific enough. It's a text file content, so which one is the best practice?
0
 
Jitendra PatilSr.Software EngineerCommented:
try the below hack.

read your whole text file data and store it in a byte array -> store it in a session object

go to the page you want -> create a byte array and restore the session object data in it.

again read the byte array and you will get all your text file data.

hope this helps.
0
 
jazzIIIloveAuthor Commented:
Hi,

Good tip, except for the case, the file must persist in remote file system if it's not there already, so session is a bad solution?
0
 
Jitendra PatilSr.Software EngineerCommented:
try the below one:

before adding the file path to session check for the physical availablity of file.

save your file to a location-> add its path to the session object.

go to next page get data of session object containing file path.

read the whole file it will be easier than the above one.

hope this helps.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now