| | |
How can I control and position textfields in a detail page?
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
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:
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.
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)
<asp:Datalist ID="dlOutputInfo" runat="server"> <ItemTemplate> <table> <tr> <td>......<%# DataBinder.Eval(Container.DataItem, strOutputInfo) %>......</td> </tr> </table> </ItemTemplate> </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.
![]() |
Similar Threads
- Dot Net programmer wanted. Work from home. (Web Development Job Offers)
- Calling a javascript function from C# (C#)
- Calculating a control position on a window (C)
- should i optimize the same keywords for each page on your site? (Search Engine Optimization)
- IE Web Page Active X Security Updates - Explained (Web Browsers)
- Dropdown menu (JavaScript / DHTML / AJAX)
- No page header and footer when printing a web page (JavaScript / DHTML / AJAX)
Other Threads in the ASP.NET Forum
- Previous Thread: Datagrid to Datatable
- Next Thread: Is Crystal Reprots Better
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols problem radio ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webservice wizard xml youareanotmemberofthedebuggerusers






