|
 |
aspx thread: about form submission
Message #1 by Leena Natekar <paradise_flycatcher@y...> on Tue, 17 Jul 2001 01:59:00 -0700 (PDT)
|
|
Hi All,
I am porting my beta1 application to beta2. I have a
basic problem here :-
In beta1 :- I used to define the form tag with the
action attribute as the form to which thi one should
be submitted to. Then define a asp button and attach
the required validators. On the next form I used to
retrieve the form variables submitted.
In Beta2 :- I defined the form (a.aspx) with the
action attribute with a value of the next
form(b.aspx). Though when I view source I see that the
action contains the value of the form which I am
displaying (a.aspx).
Does that mean that I cannot define action anymore? If
that is the case how can I submit the form? i am using
c# for server side scripting. Or does that mean I have
to use Response.Redirect? Then I have to construct the
querystring and pass with the url?
Waiting for a reply!!!!
Please throw some light on this one?
Thanks Regards,
Leena
Message #2 by "Thomas Tomiczek" <t.tomiczek@t...> on Tue, 17 Jul 2001 11:16:26 +0200
|
|
Leena,
The whole idea of ASP.NET is to have form handling "automatic". You are
supposed to have the form post back to the original form, IF you want to
use the funcationlity of a webform.
Thomas Tomiczek
THONA Consulting Ltd.
-----Original Message-----
From: Leena Natekar [mailto:paradise_flycatcher@y...]
Sent: Dienstag, 17. Juli 2001 10:59
To: ASP+
Subject: [aspx] about form submission
Hi All,
I am porting my beta1 application to beta2. I have a
basic problem here :-
In beta1 :- I used to define the form tag with the
action attribute as the form to which thi one should
be submitted to. Then define a asp button and attach
the required validators. On the next form I used to
retrieve the form variables submitted.
In Beta2 :- I defined the form (a.aspx) with the
action attribute with a value of the next
form(b.aspx). Though when I view source I see that the
action contains the value of the form which I am
displaying (a.aspx).
Does that mean that I cannot define action anymore? If
that is the case how can I submit the form? i am using
c# for server side scripting. Or does that mean I have
to use Response.Redirect? Then I have to construct the
querystring and pass with the url?
Waiting for a reply!!!!
Please throw some light on this one?
Thanks Regards,
Leena
Message #3 by Leena Natekar <paradise_flycatcher@y...> on Wed, 18 Jul 2001 04:20:52 -0700 (PDT)
|
|
Hello Thomas,
Well, I agree to that. But does that mean that the
only way for me to submit the form is to have a
Response.Redirect and I append the QueryString
manually?
Why no equivalent of form.Submit() --from javascript
is possible in C# code ( say some eventhandler? )
thanks,
Regards,
Leena
> The whole idea of ASP.NET is to have form handling
> "automatic". You are
> supposed to have the form post back to the original
> form, IF you want to
> use the funcationlity of a webform.
>
> Thomas Tomiczek
> THONA Consulting Ltd.
>
Message #4 by "Mel C Solomon" <melsolomon@e...> on Wed, 18 Jul 2001 23:00:43 -0800
|
|
Leena,
I hope I understand your question..., you can use Response.Redirect(url) to submit form values. Heres sample...
====on first page====
public void Submit_Btn(Object sender, EventArgs e)
{
DateTime now= DateTime.Now;
string req="";
req+="&&name="+txtname.Text;
req+="&&email="+txtemail.Text;
req+="&&subject="+txtsubject.Text;
req+="&&msg="+txtmsg.Text;
req+="&&dateofpost="+now.ToString();
req+="&&newpost='yes'";
Response.Redirect("postmessage.aspx?"+req);
}
....and on the next page...
void Page_Load(Object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
string name=Request.Params["name"];
string email=Request.Params["email"];
string subject=Request.Params["subject"];
string msg=Request.Params["msg"];
string dateofpost=Request.Params["dateofpost"];
}
}
hth,
mel :-)
ASP+ wrote:
>Leena,
>
>The whole idea of ASP.NET is to have form handling "automatic". You are
>supposed to have the form post back to the original form, IF you want to
>use the funcationlity of a webform.
>
>Thomas Tomiczek
>THONA Consulting Ltd.
>
>-----Original Message-----
>From: Leena Natekar [mailto:paradise_flycatcher@y...]
>Sent: Dienstag, 17. Juli 2001 10:59
>To: ASP+
>Subject: [aspx] about form submission
>
>Hi All,
>
>I am porting my beta1 application to beta2. I have a
>basic problem here :-
>In beta1 :- I used to define the form tag with the
>action attribute as the form to which thi one should
>be submitted to. Then define a asp button and attach
>the required validators. On the next form I used to
>retrieve the form variables submitted.
>
>In Beta2 :- I defined the form (a.aspx) with the
>action attribute with a value of the next
>form(b.aspx). Though when I view source I see that the
>action contains the value of the form which I am
>displaying (a.aspx).
>Does that mean that I cannot define action anymore? If
>that is the case how can I submit the form? i am using
>c# for server side scripting. Or does that mean I have
>to use Response.Redirect? Then I have to construct the
>querystring and pass with the url?
>
>Waiting for a reply!!!!
>
>Please throw some light on this one?
>Thanks Regards,
>Leena
|
|
 |