How can I control and position textfields in a detail page?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 2
Reputation: daveydave999 is an unknown quantity at this point 
Solved Threads: 0
daveydave999 daveydave999 is offline Offline
Newbie Poster

How can I control and position textfields in a detail page?

 
0
  #1
Oct 5th, 2007
This should probably be an easy question for most of you. I'm brand new to .net but not to asp.

Backend - SQL2000
Language = VB

I'm doing your basic Search - View Search Results / use hyperlink to view the details of a single record so that I can update said record.

I'll describe it in a 3 file approach:
search.aspx - > SearchResults.aspx (many records) -> Record Detail.aspx (retrieved via hyperlink on SearchResults.aspx)

The problem I'm having is that every example I've read or watched for this type of Update uses a Grid View or DetailsView grid and I don't want to be stuck in a grid. I want to have control over where I place textboxes, dropdowns, checkboxes etc... I would like absolute control if possible. I was able to do this in .asp with tables etc...

What is the best method for displaying record Details (1 record in view) in a way which I can have some control on how they are displayed? For example, I don't want any of the template / grid style views.

Can anyone point me to an example or a method for displaying the cell information in a way which I can manipulate the placement of my fields?

I know, probably a very easy answer, but I just haven't come across it!

Dave
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: How can I control and position textfields in a detail page?

 
0
  #2
Oct 5th, 2007
actually, you are almost forced to use them. But I like to stay away from GridView and DataSet. Use a DataList. Basically, just create the page you want to and bind your data to the DataList, then just add the datalist tags above and below the beggining and end of your code. Since you only have one record showing, you have no worries about repeating to break your code. Just make sure you only have one record showing! Otherwise, one of the crappiest ways to do it is bind them all to labels and literals. Labels put everthing targeted to the label in a <div> label info </div> tag. Literals just output the information. Depending on how much information you have, just use ExecuteScalar() to retrieve your record and set it equal to a string, then bind the string to the Literal/Label.

strOutputInfo = commandSelectInfo.ExecuteScalar()
labelnameorliteralname.Text = strOutputInfo & "your other info here"

Else, just create your page and try to put all your data in a table, regardless of how many tables inside that table they exist. (This prevents breaking code incase of errors). THen just put your code like this:
  1. <asp:Datalist ID="dlOutputInfo" runat="server">
  2. <ItemTemplate>
  3. <table>
  4. <tr>
  5. <td>......<%# DataBinder.Eval(Container.DataItem, strOutputInfo) %>......</td>
  6. </tr>
  7. </table>
  8. </ItemTemplate>
  9. </asp:Datalist>

Your best bet is to retrieve all the info in one SQL query if possible and just using one datalist near the begining and end it near the end of the page. Then just fill in the DataItems.

I can help, but you need to post your code, otherwise I am throwing bricks in a pond trying to knock out a fish.
Last edited by SheSaidImaPregy; Oct 5th, 2007 at 10:25 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 2
Reputation: daveydave999 is an unknown quantity at this point 
Solved Threads: 0
daveydave999 daveydave999 is offline Offline
Newbie Poster

Re: How can I control and position textfields in a detail page?

 
0
  #3
Oct 9th, 2007
Thanks you ShesA!

I'll give this a try today. I thought I was the only person in the universe who was feeling trapped by the grids. They are just not efficient in use of space and layout. It's good to know someone else is thinking outside of the grid ;-)

I'll get back with an update.

dave
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1
Reputation: jameskwatro is an unknown quantity at this point 
Solved Threads: 0
jameskwatro jameskwatro is offline Offline
Newbie Poster

Re: How can I control and position textfields in a detail page?

 
0
  #4
Aug 27th, 2008
can anyone help me.. i have a problem regarding my website i created a login page but then when a user login to see his/her profile the details view only shows the first record in the database? how can the details view show the profile of the person who login in a details view?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: How can I control and position textfields in a detail page?

 
0
  #5
Aug 27th, 2008
This will be done through your query language, not ASP.NET. However, go ahead and post your query / code and I'll see what I can do to help.
I answer pm's.
I answer questions.
I answer quickly.
I answer.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC