Home All Groups Group Topic Archive Search About

How submit values by POST method?

Author
5 Feb 2007 11:37 PM
SushiSean
Hello. I have question about POST form submit and it consist from 2 parts
1. Part One:
There are exist in asp.net framework2 method which allow make something like
this. I have a server form (FORM1), TextBox control (textBox1) and button
control (button1). All of those server controls.
When I click on textBox1 I need get server event and run some server code
which check value from textBox1 and if it is correct make POST redirect on
some page (page2.aspx), but if it isn't correct I want get the same page
(page1.aspx) with all inputed info in textBox1 and make some response.write -
something like "this information not correct". 
If info correct I want get it in Request.Form["textBox1"] on next page
(page2.aspx)
Is it possible? If yes then give me some code like example.


2. Part two.
I have the same page (page1.aspx) but this page use Master Template. And for
example in Page_load event I get some info from database and want transver it
to other page by POST method.

If I use sever control like textbox to keep this value on next page
(page2.aspx) I will get some strange value names like this
"ctl00$ContentPlaceHolder1$text1". Get those values by POST after click on
button1 which PostBackUrl="~/page2.aspx"...
Why I receive that prefix and how I can be sure which it will be next time?

Only one way work correct I can make Response.Write with just html code
inside a server form "<input name=CareditCard type=hidden value=1111 />" and
it is work, but it looks like very stupid way to do this. There are exist
some way to always be sure which value names will be? Or even disable those
prefixes at all.

Thanks, wating of answer...

AddThis Social Bookmark Button