September 30th, 2003, 07:41 AM
I am biginner in ASP.NET
I have one query as Follows
In ASp.NET I want to post value into other file .how I do this?
September 30th, 2003, 10:46 AM
where is this value coming from and what is the file you want to post it to?
September 30th, 2003, 02:37 PM
Your question is not very good:
Please remember, we cannot read your mind, or magically see your code.
What is your query? Are you using ADO or ADO.NET? What file do you want to post it to? Another form? A text file? A webservice?
Specifics will allow us to help you out much better!
October 1st, 2003, 12:10 AM
Dear all ,
first i have one one.aspx file this file content web form control.
through this file I want to post control's value to other two.aspx
how I post this value to other file
October 1st, 2003, 09:17 AM
Nice... Now we can help you!
Ok, so you want to communicate between forms in a web environment! This is quite simple.
FOR LEARNING: read about WEBFORMS from just about any source.
On FORM1.ASPX you must ensure that you have a FORM tag within your HTML <FORM></FORM>. This form tag tells the system that you have a WEBFORM that you want to use. A WEBFORM's job is to gather data and post it somewhere.
The form tag will have attributes that tell the form where to post the data it has received. In ASP.NET it will look like this:
<form id="Form1" method="post" runat="server">
Inside of that FORM TAG you must have some sort of button element something like this:
<input type="submit" value="ButtonName" runat="Server" ID="Submit1" NAME="Submit1">
Now in your code behind page (if you don't know this, you really need to do some reading) you will have an event for this button, just like in VB, and you will act on that form and it's information. The trick here, is you really don't need to submit to another page, but you can. Here is a sample (button click) event:
Private Sub Submit1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.ServerClick
Dim Val1, Val2, Val3 As Integer
Val1 = textbox1.text
Val2 = textbox2.text
Val3 = Val1 + Val2
Response.Redirect("Page2.aspx?Val3=" & Val3)
Now this is just one example. There are actually several ways to do this stuff, all depending on what your desired outcome will be. Try reusing the same form, you will acutally have some really cool results. The form is automatically in POSTBACK mode. You can actually have it post all of it's results to another page, but that was really the OLD way of doing things in legacy ASP. Now with the advent of CODE BEHIND pages, you really are better off doing a postback, running your routines/functions then if you need, go to another form.
October 1st, 2003, 11:57 PM
October 2nd, 2003, 10:57 AM
Glad I could help out!
(and why am I still a junior member? hahahahaahaha!)
October 3rd, 2003, 06:53 AM
you can use forms, query strings, cookies and one other (it escapes me at present but i'll track it down sooner or later..)
i'd have suggested cookies since they're real easy to learn how to implement..