K
Kevin Blount
bit long winded this one, so stick with me:
I'm trying to create a form that can go to one of 3 places, depending on
various elements. My form control looks like this:
<form runat="server" ID="myForm" method=POST>
so, first thing: how can I dynamically set the "Action" parameter? I
know that with <asp:HiddenField...> for example, I have to do something
like this:
<% fieldID.Value = "stringContent" %>
<asp:HiddenField ID="fieldID"></asp:HiddenField>
so I'm guessing I can do the same kind of thing for the form control,
but "myForm.Action" doesn't appear to work.
I also tried
<% string myString = "here.aspx" %>
<form runat="server" ID="myForm" method=POST action="<%= myString %>">
but that didn't work either.
Here's the second part:
To get the value of the forms Action, I need to connect to a database,
so I setup a DataTable and grab the data. I figure I need to do this
outside of the <form> tag, so that I can put the value into it's Action,
but I also want to be able to use that DataTable inside the form, but
I've found that anything I setup before the <form runat=server> line
isn't accessible within the form (such as the other fields from the
database for populating the form textboxes.
Can I set up a string, int, DataTable, etc outside the form that can
also be used inside it? If so, please please tell me how
Cheers
Kevin
I'm trying to create a form that can go to one of 3 places, depending on
various elements. My form control looks like this:
<form runat="server" ID="myForm" method=POST>
so, first thing: how can I dynamically set the "Action" parameter? I
know that with <asp:HiddenField...> for example, I have to do something
like this:
<% fieldID.Value = "stringContent" %>
<asp:HiddenField ID="fieldID"></asp:HiddenField>
so I'm guessing I can do the same kind of thing for the form control,
but "myForm.Action" doesn't appear to work.
I also tried
<% string myString = "here.aspx" %>
<form runat="server" ID="myForm" method=POST action="<%= myString %>">
but that didn't work either.
Here's the second part:
To get the value of the forms Action, I need to connect to a database,
so I setup a DataTable and grab the data. I figure I need to do this
outside of the <form> tag, so that I can put the value into it's Action,
but I also want to be able to use that DataTable inside the form, but
I've found that anything I setup before the <form runat=server> line
isn't accessible within the form (such as the other fields from the
database for populating the form textboxes.
Can I set up a string, int, DataTable, etc outside the form that can
also be used inside it? If so, please please tell me how

Cheers
Kevin