Response.Write, Form and IsPostBack

G

Guest

I have a page that calls a public sub that is in the code behind page. This
sub will, depending on the number of records, write out a number of
statements. One of the statements that is repeated for each record is:

<form id='frmViewEmployeeDetail' name='frmViewEmployeeDetail' runat=server
method='post' action='ViewEmployeeDetail.aspx'>

The problem that I'm having is that this is not creating a server side
control, so when the page is submitted 'IsPostBack' is never set to true. Is
there a way around this problem?

Thanks.
 
C

Curt_C [MVP]

CBKowitz said:
I have a page that calls a public sub that is in the code behind page. This
sub will, depending on the number of records, write out a number of
statements. One of the statements that is repeated for each record is:

<form id='frmViewEmployeeDetail' name='frmViewEmployeeDetail' runat=server
method='post' action='ViewEmployeeDetail.aspx'>

The problem that I'm having is that this is not creating a server side
control, so when the page is submitted 'IsPostBack' is never set to true. Is
there a way around this problem?

Thanks.

append a value to the action that you search for in the page_load.
 
G

Guest

Curt,

I don't understand your response. The form statement is being written out
with a response.write and I need to know if there is a way, once the line is
written, to tell the system that I want it to be a server control.

Thanks.
 
C

Curt_C [MVP]

you are trying to have multiple FORM tags in the page?
You may want to rethink
 
I

intrader

I have a page that calls a public sub that is in the code behind page. This
sub will, depending on the number of records, write out a number of
statements. One of the statements that is repeated for each record is:

<form id='frmViewEmployeeDetail' name='frmViewEmployeeDetail' runat=server
method='post' action='ViewEmployeeDetail.aspx'>

The problem that I'm having is that this is not creating a server side
control, so when the page is submitted 'IsPostBack' is never set to true. Is
there a way around this problem?

Thanks.
To my knowledge the only way that you can generate a server-side confrol
is declaratively or my means of the LoadContol method.
Response.Write is not able to generate server-side controls.
 
I

intrader

you are trying to have multiple FORM tags in the page?
You may want to rethink
Curt, please see my response.
It is a tough nut to crack to generate server-side controls from within
asp.net!
 

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

IsPostBack 4
IsPostBack 1
Responsive form 0
response.write giving error 3
A simple form question 2
Change form action 0
AJAX and IsPostBack 5
Login form no longer working 2

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top