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

Posting form data to another page

106 100+
Hi

I have Two pages Default.aspx and Default2.aspx

Default.aspx has the following code


<%@ Page Language="VB" MasterPageFile="~/Main.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<form id="searchform" runat=server action=Default2.aspx method=post>
First Name :: <asp:TextBox ID="Name" runat=server ></asp:TextBox>
Last Name :: <asp:TextBox ID="Lname" runat=server></asp:TextBox>
<asp:Button UseSubmitBehavior=true runat=server />
</form>

</asp:Content>

and Default2.aspx has label control and Default2.aspx.vb has the following code

<%

Partial Class Default2
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = Request.Form("Name")
End Sub
End Class

%>

but this doesn't work.
I don't know how i get the form data. Please Help.
Mar 24 '08 #1
2 1317
Hello,

I can't say for 100%, but my best bet is that ASP.NET is not using you're literal ID's on the client, so the post back to Default2.aspx uses different names for your form fields...

You may want to open up the source of Default.aspx, find the <input> tags and check their name properties, since that is what you will have to use within the Request.Form("xxx") function...

Hope thats the case,

- Loren Van Spronsen
Mar 24 '08 #2
Hamayun Khan
106 100+
Thanks for Help.

It is working well for one page. I have to post form data from more than one page. In that case the ids are auto generated and they are not same on different pages.

I m new to asp.net. I don't know how to use session in asp.net if someone give me some hints about session i can store the values on click event of button to session variables.
Mar 24 '08 #3

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

Similar topics

2
by: HANG LAM | last post by:
Hi, Simple question, Is there a way to post the data from one .aspx page to another page ? For example, I have a Page1.aspx that lets the user enter data like "Last Name", "First Name", but...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
10
by: DaveFash | last post by:
Posting variables from an HTML FORM, via the Request.Form function on the receiving ASP page is great. But how can you POST a Form variable to an ASP page -- without a human pushing a Submit...
5
by: Magnus | last post by:
Hi! This is my problem: I want to go from page1 to page2, and to get all the form variables from page1 to page2. I have turned the viewstate and the sessionstate off, and i really just...
4
by: Newbie | last post by:
Hi, I need help in posting asp .net application web form to another asp based web app. I have seen many examples using HttpWebRequest class but the problem is I do not want the request back...
2
by: ejs | last post by:
Please read the entire reponse, hopefully this clears up your questions. The data used that needs to go into the batchupload page comes from a server. My problem is that currently I write a file...
8
by: -Karl | last post by:
Apparently, asp.net has a posting issue with refreshing. There seems to be several solutions to the issue but I was wondering if there is a final workaround for the issue? If so, can you please...
2
by: Stu | last post by:
Hi, When I try and use Javascript to post page form data from one aspx page to another I get the error 'Unable to validate data. '. I am not trying to read the data using web controls I am...
3
by: Peter Afonin | last post by:
Hello, I'm posting the data to another page and reading the results. I'm doing it approximately as described here: http://authors.aspalliance.com/stevesmith/articles/netscrape2.asp It works...
4
by: Peter Afonin | last post by:
Hello, I have a form with several buttons, and I need to post this data to several different applications. In ASP.NET 1.1 it was quite easy - I just used HTML controls (text or hidden), then...
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
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
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
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,...
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...

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.