Newbie : Form question !

S

Stan SR

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
 
A

Augustin Prasanna

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
 
S

Stan SR

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"
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 said:
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
 
A

apathetic

What I need is to get
<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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Hyperlinks in User Controls (1.1) 2
That must be easy! 2
The SID question?! 2
session IDS 1
SessionsIDs 4
NewSID and Sysprep problem 3
Recycler Folder reply to Wes... 3
SID, Container and Document object 3

Top