The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> .Net Development
|
Biginner Question
Discuss Biginner Question in the .Net Development forum on Dev Shed. Biginner Question .NET development forum discussing all .NET derivatives including C#, VB.NET, ASP.NET, ADO.NET and more. Learn the ins and outs of using the .NET framework.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

September 30th, 2003, 07:41 AM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 9
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Biginner Question
Dear All,
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?
Thanks
Boston_WEB
|

September 30th, 2003, 10:46 AM
|
|
Contributing User
|
|
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 462
  
Time spent in forums: 14 h 1 m 30 sec
Reputation Power: 12
|
|
|
where is this value coming from and what is the file you want to post it to?
|

September 30th, 2003, 02:37 PM
|
|
Junior Member
|
|
Join Date: Sep 2003
Location: SC
Posts: 26
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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!
Thanks!
|

October 1st, 2003, 12:10 AM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 9
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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
Thanks,
Boston
|

October 1st, 2003, 09:17 AM
|
|
Junior Member
|
|
Join Date: Sep 2003
Location: SC
Posts: 26
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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.
FOR IMPLEMENTATION:
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)
End Sub
=========================================
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.
Good Luck!
|

October 1st, 2003, 11:57 PM
|
|
Junior Member
|
|
Join Date: Mar 2003
Posts: 9
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Thanks emladris
|

October 2nd, 2003, 10:57 AM
|
|
Junior Member
|
|
Join Date: Sep 2003
Location: SC
Posts: 26
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Glad I could help out!
(and why am I still a junior member? hahahahaahaha!)
|

October 3rd, 2003, 06:53 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Location: Sheffield, UK
Posts: 94
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
|
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..
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|