Populating textbox in Formview with a QueryString

D

David Wertz

I am sure that I am missing something very simple here or my entire approach
is flawed. All I am trying to accomplish is to create a new record and carry
over the customer id to be saved with the new contract.

I have a button on a customer form to create a new contract record.

Response.Redirect("~/ContentPages/Contract.aspx?id=-1&custid=" & CustID)


I am passing CustID as a querystring from one page to another page called
'contract.aspx'. I also pass the ID=-1 to indicate that it is a NEW record
and to change the mode of the Formview to 'Insert' mode.

On contract.aspx I have a Formview control called 'frmContract'. In the
'ItemInsertTemplate' I have textboxes for each field of the contract record
including one for CustID. All of the textboxes are databound to a
SQLDATASOURCE.

MY PROBLEM:

I cannot get CustID into the tbxNewCustID textbox so that it gets inserted
during the update command. I cannot figure out how to get a reference to the
textbox within the FORMVIEW control. How can I do something like

'formview.tbxNewCustID = QuerystringParameter'?

I hope I have described this well enough.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top