943,945 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1945
  • ASP.NET RSS
Oct 5th, 2007
0

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

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
daveydave999 is offline Offline
2 posts
since Oct 2007
Oct 5th, 2007
0

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

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:
ASP.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Oct 9th, 2007
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
daveydave999 is offline Offline
2 posts
since Oct 2007
Aug 27th, 2008
0

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

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jameskwatro is offline Offline
1 posts
since Jul 2008
Aug 27th, 2008
0

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

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.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Datagrid to Datatable
Next Thread in ASP.NET Forum Timeline: Is Crystal Reprots Better





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC