Re: Help with Visual Studio (beginner)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Andrei Pociu (andrei_pociu_at_geekpedia.com)
Date: 03/07/05


Date: Mon, 7 Mar 2005 08:18:16 +0200

You use Request.QueryString["fieldname"] for parameters passed in the URL,
but not from a form that uses POST method.

I also come from a PHP background, and .NET works fairly different. You
simply change the value of a label with the text from a textbox just like
you would in any other application (assuming you use code-behind):

if(IsPostBack)
{
lblName.Text = txtName.Text;
}

That's the charm of .NET.

"Lionel LASKE" <llaske@c2s.fr> wrote in message
news:OFs3X9fFFHA.3908@TK2MSFTNGP12.phx.gbl...
>
> You just have to use Request.QueryString["fieldname"] in
> webform2.Page_Load to get the value of your field in webform1.
> For PHP to ASP.NET, a good link for you:
> http://msdn.microsoft.com/asp.net/migration/phpmig/
>
> Lionel.
>
>
> "tripwater" <tsmith@sonador.com> a écrit dans le message de news:
> eZ8nLOcFFHA.3368@TK2MSFTNGP10.phx.gbl...
>> Hello,
>> I am a php programmer moving over to ASP.NET, VS and C#. I am having a
>> few problems getting started. I have everything installed and running, it
>> is more or less figuring out how to do simple things.
>>
>> I have a test form called webform1 with one field on it for a first name.
>> I am trying to figure out how to post this info to webform2 and display
>> the field value on webform2 in a label. In php and HTML all I had to do
>> was put webform2 in the action property of the form of webform1 and on
>> post, access the post var by $HTTP_POST_VARS["firstname"].
>>
>> I figured out how to pass the value over to the other page via query
>> string. But if I had a form with 30 fields on it this would get tiresome.
>> I just need some guidance as to what I need to do to accomplish this
>> simple task so I can continue learning. I have been stuck on this for
>> days and can not find a tutorial online that goes beyond posting to the
>> same page (i.e: webform1 posts info to webform1).
>>
>> So I basically need to know how to pass a form's values to another page
>> and then access those variables on the next page(not the same page)
>> within Visual Studio (C#).
>>
>>
>> Thank you for any help in this.
>>
>
>



Relevant Pages

  • Re: PHP + Checkbox values
    ... trying to send multiple values of checkbox element using POST method. ... I am always getting only one element in the array. ... (I an using PHP 5.2.5) ... If I select first two checkboxes, I get the following for ...
    (comp.lang.php)
  • Re: Building web applets with Haskell and PHP
    ... I miss the routine in PHP and I make a lot of mistakes. ... in the form tag, then the POST method doesn't work, only the GET ... that they had some kind of safe mode ... Two entirely different things, and I highly suspect they will be disabled even when your host upgrades, for their own system protection. ...
    (comp.lang.php)
  • Re: cant retrieve $_POST variables
    ... Yeah, good guess!!! ... I put it in a hidden field 'action' ... >> Our PHP version is 4.2.1 ... >> I have a simple form using the POST method. ...
    (alt.php)
  • Re: calling a javascript alert from php
    ... You can simply let PHP do all the work. ... // This form uses the POST method, so process any post selections here ... // display any book details based on the user's selection ...
    (comp.lang.php)
  • Re: Search MySQL db with PHP
    ... check the manual that corresponds to your MySQL ... as well as researching PHP and Googling the error. ... foreach ($params as $param) { ...
    (alt.php)