Creating a custom detail's screen

  • Thread starter Thread starter David Lozzi
  • Start date Start date
D

David Lozzi

OK, here's what I want to do. Display a list of items in a datagrid, which works great! When a user clicks on one of the items, they are sent to another page to view its details. Now here is where I am having an issue. I would like to display the data like so

General Info EDIT
Item Name: this and that
Desc2: woo hoo
Price: $3
Detailed Info EDIT
Height: 3
Width: 2
Weight: 5

See what I mean? A DataGrid doesn't appear to be what I want, nethier a DataList. A repeater might do it, but can I have a Header (general) then Item then another Header?

I've tried to connect to SQL, then pull the queried data, which works grand, see below:

Dim myConnection As New SqlConnection(sqlConn)
Dim myCommand As New SqlCommand()
Dim rec as SqlDataReader

myconnection.open()

myCommand.Connection = myConnection
myCommand.CommandText = sqlQry
rec = MyCommand.ExecuteReader()

I have done something like Session("user") = rec("user") and it's worked, but this is within the <script> tags. But it does not work to do the following in HTML

<form runat=server>
Item Name: <%=rec("itemname")%><br>
</form>

I get the following error on that line, BC30451: Name 'rec' is not declared.

I can of course use a label like so:

itemname.text = rec("itemname")
</script>
<html>
.......
<asp:label id="itemname" runat="Server" />




So, what is the best way of completing this task?
THANKS!!
 
OK, I reviewed some docs and found that using the <% %> style is not a recommend way, that using server controls are preferred, i.e. the label.

Is this the best way then? Also, like the DataGrid edit option, how difficult would it be to get this to run similiarly?

Thanks,

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com


OK, here's what I want to do. Display a list of items in a datagrid, which works great! When a user clicks on one of the items, they are sent to another page to view its details. Now here is where I am having an issue. I would like to display the data like so

General Info EDIT
Item Name: this and that
Desc2: woo hoo
Price: $3
Detailed Info EDIT
Height: 3
Width: 2
Weight: 5

See what I mean? A DataGrid doesn't appear to be what I want, nethier a DataList. A repeater might do it, but can I have a Header (general) then Item then another Header?

I've tried to connect to SQL, then pull the queried data, which works grand, see below:

Dim myConnection As New SqlConnection(sqlConn)
Dim myCommand As New SqlCommand()
Dim rec as SqlDataReader

myconnection.open()

myCommand.Connection = myConnection
myCommand.CommandText = sqlQry
rec = MyCommand.ExecuteReader()

I have done something like Session("user") = rec("user") and it's worked, but this is within the <script> tags. But it does not work to do the following in HTML

<form runat=server>
Item Name: <%=rec("itemname")%><br>
</form>

I get the following error on that line, BC30451: Name 'rec' is not declared.

I can of course use a label like so:

itemname.text = rec("itemname")
</script>
<html>
......
<asp:label id="itemname" runat="Server" />




So, what is the best way of completing this task?
THANKS!!
 
What I would do in Code-Behind is grab the id of the user that you want to edit and call a method call GetUser that retrieves the user information from the table in the database and displays the information using asp:TextBox. Allow the user to edit the information and then click an update button and call a method called UpdateUser that sends the data back to the database and updates it.

OK, I reviewed some docs and found that using the <% %> style is not a recommend way, that using server controls are preferred, i.e. the label.

Is this the best way then? Also, like the DataGrid edit option, how difficult would it be to get this to run similiarly?

Thanks,

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com


OK, here's what I want to do. Display a list of items in a datagrid, which works great! When a user clicks on one of the items, they are sent to another page to view its details. Now here is where I am having an issue. I would like to display the data like so

General Info EDIT
Item Name: this and that
Desc2: woo hoo
Price: $3
Detailed Info EDIT
Height: 3
Width: 2
Weight: 5

See what I mean? A DataGrid doesn't appear to be what I want, nethier a DataList. A repeater might do it, but can I have a Header (general) then Item then another Header?

I've tried to connect to SQL, then pull the queried data, which works grand, see below:

Dim myConnection As New SqlConnection(sqlConn)
Dim myCommand As New SqlCommand()
Dim rec as SqlDataReader

myconnection.open()

myCommand.Connection = myConnection
myCommand.CommandText = sqlQry
rec = MyCommand.ExecuteReader()

I have done something like Session("user") = rec("user") and it's worked, but this is within the <script> tags. But it does not work to do the following in HTML

<form runat=server>
Item Name: <%=rec("itemname")%><br>
</form>

I get the following error on that line, BC30451: Name 'rec' is not declared.

I can of course use a label like so:

itemname.text = rec("itemname")
</script>
<html>
......
<asp:label id="itemname" runat="Server" />




So, what is the best way of completing this task?
THANKS!!
 
OK, I know how to edit the info correctly, I was hoping I could use the Edit feature built into the DataGrid or whatever is used.

Is it possible to turn a datagrid 90degrees? so have the header values on the left instead at the top?

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com


What I would do in Code-Behind is grab the id of the user that you want to edit and call a method call GetUser that retrieves the user information from the table in the database and displays the information using asp:TextBox. Allow the user to edit the information and then click an update button and call a method called UpdateUser that sends the data back to the database and updates it.

OK, I reviewed some docs and found that using the <% %> style is not a recommend way, that using server controls are preferred, i.e. the label.

Is this the best way then? Also, like the DataGrid edit option, how difficult would it be to get this to run similiarly?

Thanks,

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com


OK, here's what I want to do. Display a list of items in a datagrid, which works great! When a user clicks on one of the items, they are sent to another page to view its details. Now here is where I am having an issue. I would like to display the data like so

General Info EDIT
Item Name: this and that
Desc2: woo hoo
Price: $3
Detailed Info EDIT
Height: 3
Width: 2
Weight: 5

See what I mean? A DataGrid doesn't appear to be what I want, nethier a DataList. A repeater might do it, but can I have a Header (general) then Item then another Header?

I've tried to connect to SQL, then pull the queried data, which works grand, see below:

Dim myConnection As New SqlConnection(sqlConn)
Dim myCommand As New SqlCommand()
Dim rec as SqlDataReader

myconnection.open()

myCommand.Connection = myConnection
myCommand.CommandText = sqlQry
rec = MyCommand.ExecuteReader()

I have done something like Session("user") = rec("user") and it's worked, but this is within the <script> tags. But it does not work to do the following in HTML

<form runat=server>
Item Name: <%=rec("itemname")%><br>
</form>

I get the following error on that line, BC30451: Name 'rec' is not declared.

I can of course use a label like so:

itemname.text = rec("itemname")
</script>
<html>
......
<asp:label id="itemname" runat="Server" />




So, what is the best way of completing this task?
THANKS!!
 
Back
Top