Thursday, March 29, 2012

Newbie : Form question !

Hi,

I use a Unique Identifier data for my website that I get using the
Request["sid"]
That means most of my links are formatted like mypage.aspx?sid=blabla

So, I need to understand how to add the "?sid=blabla" onto a page where I
have a form with several fields

Do I have to add a hidden field to store the blabla ?

Thanks for your help

Stanyou can either add a querystring or have a hidden field (having method as
'Get' will add all the form fields as querystring parameters)..

Regards,
Augustin

"Stan SR" <stan@.pasdepam.netsunset.comwrote in message
news:%23MWDGKd7GHA.1256@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hi,
>
I use a Unique Identifier data for my website that I get using the
Request["sid"]
That means most of my links are formatted like mypage.aspx?sid=blabla
>
So, I need to understand how to add the "?sid=blabla" onto a page where I
have a form with several fields
>
Do I have to add a hidden field to store the blabla ?
>
>
Thanks for your help
>
Stan
>
>
>
>
>


Yes. I have no doubt about this, but how to set the variable as a
queryString parameter when a page is Loaded ?

here's my case :

<form id="form1" runat="server>
<asp:CheckBox id="b" runat="server" text="test" />
</form>

In my codeBehind, I check if a "sid" url parameter is transmitted.
If not I generate one.
And I would like to place it a url parameter.

When I look at the source, I get this

<form name="form1" method="post" action="mypage.aspx" id="form1">
<input id="b" name="b"><label for "b">test</label>
</form>

What I need is to get
<form name="form1" method="post" action="mypage.aspx?sid=blabla" id="form1">

Stan

"Augustin Prasanna"

Quote:

Originally Posted by

you can either add a querystring or have a hidden field (having method as
'Get' will add all the form fields as querystring parameters)..
>
Regards,
Augustin
>
"Stan SR" <stan@.pasdepam.netsunset.comwrote in message
news:%23MWDGKd7GHA.1256@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hi,
>>
>I use a Unique Identifier data for my website that I get using the
>Request["sid"]
>That means most of my links are formatted like mypage.aspx?sid=blabla
>>
>So, I need to understand how to add the "?sid=blabla" onto a page where I
>have a form with several fields
>>
>Do I have to add a hidden field to store the blabla ?
>>
>>
>Thanks for your help
>>
>Stan
>>
>>
>>
>>
>>


>
>


What I need is to get

Quote:

Originally Posted by

<form name="form1" method="post" action="mypage.aspx?sid=blabla" id="form1">


You could set this in Page.Form.Attributes or use the PostBackUrl
property of your submit button to send the form to the new URL.

Tim

0 comments:

Post a Comment