473,385 Members | 2,029 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,385 software developers and data experts.

how to pass value to a asp file not using form post/get?

17
Hi, All.
I want to pass a value to asp file on server side but NOT using form post/get. For example:[html]
<input id="regionbox" type="hidden" name="region" value="abc">


function dothing
...
request.open("GET", "do.asp?"+Date.parse(Date()), true);
...[/html]do.asp file on server side should respond to abc and do sth.
Expand|Select|Wrap|Line Numbers
  1. do.asp
  2. <%
  3. if (???="abc") then
  4. s="http://www.123.com"
  5. end
  6. if (???="abc0") then
  7. s="http://www.000.com"
  8. end
  9.  
  10. use s to do sth
  11.  
  12. ...
  13. %>
It seems ??? can not be replaced with request.querystring(). How to do it?

Please show code.
Thank you very much in advance.
Oct 1 '07 #1
3 4272
jhardman
3,406 Expert 2GB
I'm not sure I understand you. You are saying that you are having troubles adding querystring? I would guess that the problem lies in the javascript junction that adds data to the url. Shouldn't it be more like:
Expand|Select|Wrap|Line Numbers
  1. function dothing
  2. ...
  3. window.open("do.asp?myDate="+Date.parse(Date())+"&myVal=true");
  4. ...
If you explain a little more what you are trying to do, I will try to explain more how I would do it.

Jared
Oct 1 '07 #2
1965
17
Thank you very much, jhardman.

Let me explain more. I am using proxy script on server side to dynamically retrieve data from 10 rss sources. When the user clicks on one of rss in browser, I want to pass which rss has been clicked and pass the clicked url and name to a proxy script on server. The proxy script handles retrieval of data based on url/name received, and then send data to browser for parsing in order to display.

I can handle one rss retrieval on server side in STATIC way, using one asp file. That is why I want to know how to pass choices by user to that same script on server in order to have Select Case or QueryString or sth else to retrieve the data that user clicks. That is why I want to pass the value.

As form submit post/get is not suitable in current case, can I have other ways to workaround. Google search on this topic says using a hidden input and when user clicks a link, catch the link in that hidden input box using document.getelementbyid.value. Yes, we can catch that value by using document.getelementbyid.value, but how can i pass that value to the proxy script on server side.

I do not know if i have made it clear.

Thank you again.
Oct 2 '07 #3
jhardman
3,406 Expert 2GB
OK, I think I understand the idea, but why is form submit not an option? That is easier and more straight-forward then adding a value to the url, plus url formatting has very specific character restraints and ASP does not have a built-in URLDecode function.

From your example it appears that you are putting the data in the URL but the syntax is garbled. I'm not an expert on javascript but it sounds like it is the javascript that is having a problem, rather than the ASP. After the javascript makes the URL it should look like this:
Expand|Select|Wrap|Line Numbers
  1.  "do.asp?myDate=10%2F2%2F2007&myFeed=rssFeed%2Erss"
notice the characters that need to be escaped and notice the syntax of "page.asp?name=value&name=value". Does this answer your question? If this is too tricky, let me see if I can show you how to do it using a form input (which is a lot simpler).

Jared
Oct 2 '07 #4

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

Similar topics

2
by: Matt | last post by:
How to pass data back and forth between ASP and JSP page? Let's say I have Java objects, how to pass the data back to ASP page?? Or ASP has data, how to pass the data to JSP page?? Please...
5
by: Belinda | last post by:
Hello All I have the following test.asp page which needs one parameter querystr but my querystr is a very long string value. When I send a long value the query string is getting truncated after...
3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
19
by: nazgulero | last post by:
Hello all, I wonder if anybody can give me a hint about what I have to do to get this working: I am creating a drop down box using the script below. The result is two text fields; now I want...
15
by: Jack | last post by:
Hi, I have a asp form where one element is a list box which lists four years starting from 2004. This list is drawn from a database table which has YearID and Year as two fields as shown below:...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
4
by: IRC | last post by:
hey, i am pretty new on javascript as well as PHP, Hey, anyone can you help me, how to pass the javascript array value to php page......... i want to retrieve the values which are arrayed on...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.