473,413 Members | 1,807 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,413 software developers and data experts.

Question on PostBack method

Is there a method in ASP similar to PostBack method in ASP.NET? I have an asp file which reads each line in a text file as hyperlink, when clicked, shows the details of the product of that line. I would like to get both the asp pages to be visible in the same window. How do I achieve this?

Please help.

Krithika
Sep 19 '07 #1
4 1307
jhardman
3,406 Expert 2GB
Krithika,

You can do similar things to postBack in ASP, but you will have to code it yourself. When you say you want two pages in the same window, how do you mean?

Jared
Sep 19 '07 #2
Krithika,

You can do similar things to postBack in ASP, but you will have to code it yourself. When you say you want two pages in the same window, how do you mean?

Jared
I have a form which, when submitted shows some result. I want this result along with the form(showing previous selection) in the same window. Now when I call the asp file in the action, it shows the result in the new window. So I'm not able to see the form and the results together.

Is it possible to achieve this?
Sep 20 '07 #3
jhardman
3,406 Expert 2GB
...Is it possible to achieve this?
absolutely. first, make sure the action attribute is the same page as the starting page. You fill in the inputs of the form using <%=request.form("inputName")%> and put the result within an if...then statement so that it only displays if the form was submitted. The page might look something like this:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="thisSamePage.asp">
  2. Type your name here: <input type="text" name="userName" 
  3. value="<%=request.form("userName")%>"><br>
  4. How old are you? <input type="text" name="age" 
  5. value="<%=request.form("age")%>"><br>
  6. What is your favorite color? <select name="favColor">
  7. <%
  8. dim opt(6), x
  9. opt(0) = "red"
  10. opt(1) = "orange"
  11. opt(2) = "yellow"
  12. opt(3) = "green"
  13. opt(4) = "blue"
  14. opt(5) = "indigo"
  15. opt(6) = "violet"
  16. for x = 0 to 6 %>
  17.    <option value="<%=opt(x)%>"
  18.    <%
  19.    if opt(x) = request.form("favColor") then response.write "selected" %>
  20.    ><%=opt(x)%></option>
  21. <%
  22. next %>
  23. </select>
  24. <input type="submit" name="submit" value="submit"></form><br>
  25. <%
  26. if request.form("submit") <> "" then %>
  27.    <p><%=request.form("userName")%> is <%=request.form("age")%> years old.
  28.    <p><%=request.form("userName")%>'s favorite color is <%=request.form("favColor")%>
  29. <%
  30. end if %>
Let me know if this helps.

Jared
Sep 20 '07 #4
Thank you very much for your timely help. Your suggestion has helped me finish my work. Thanks again.

Krithika
Sep 24 '07 #5

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

Similar topics

13
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is...
6
by: V | last post by:
I have found that when I have a composite control that uses the CreateChildControls method, on a regular page load, Page_Load executes before CreateChildControls, but on a postback it is the...
3
by: suzy | last post by:
hi, i am a professional asp developer, and when i used to code in normal ASP code i didn't use the design view in interdev. instead i just used code to draw any tables/forms, etc that i needed....
5
by: Matthew Louden | last post by:
I created simple ASP.NET web application to test how AutoPostBack property in a web control works. I set AutoPostBack property to be true of a web control. When I run the application, here's the...
4
by: Karl Hungus | last post by:
how come RaisePostBackEvent doesn't work correctly if the IPostBackDataHandler isnt implemented. It seems that I must at least have: public bool LoadPostData(String postDataKey,...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
0
by: Kevin Blount | last post by:
I'm trying to create a mutli-form page on my website, but having trouble with the PostBack stuff. And yes, I'm new to C# - my background of 8yrs is original ASP, and I'm getting easily confused...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.