form posting

V

VJ

I have:

page one
<form runat=server>
<asp:TextBox ID="fTime" runat="server" Visible="true" Text='<%#
DataBinder.Eval(Container.DataItem, "fTime", "{0:h:mm tt}")%>'/>

<asp:Button ID="Purchase" runat=server Text="buy" Heigh="3mm"
Width="15mm" PostBackUrl="page2.aspx"/>
</form>

and i'm trying to pass it to a session on page two and I'm making no
progress.

page two..
<script language="c#" runat="server">
void Page_Load(object sender, EventArgs e)
{
TextBox fTime;
fTime = (TextBox)Page.PreviousPage.FindControl("fTime");
Session["fTime"] = fTime;
}

</script>
 
G

Guest

VJ,
The reason this is blowing up is that you are setting the "fTime" textbox
CONTROL itself into the Session variable, instead of

Session["fTime"] = fTime.Text;
-- the time Text that the control was displaying.

HTH
Peter
 

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

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top