#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    9
    Rep 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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Windsor ON, Canada
    Posts
    462
    Rep Power
    13
    where is this value coming from and what is the file you want to post it to?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    SC
    Posts
    26
    Rep Power
    0

    Wink 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!
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    9
    Rep 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
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    SC
    Posts
    26
    Rep Power
    0

    Wink 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!
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    9
    Rep Power
    0
    Thanks emladris
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    SC
    Posts
    26
    Rep Power
    0

    Talking Glad I could help out!


    (and why am I still a junior member? hahahahaahaha!)
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Sheffield, UK
    Posts
    94
    Rep Power
    11
    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..

IMN logo majestic logo threadwatch logo seochat tools logo