Ive got ASP.NET web application form where users enter details such as:
Subject Code
Subject Name
Subject Details ....etc
I would like the users to click on plus(+) or add button which creates new empty rows for users to fill above fields. They can enter up to x number of subjects.
Is there any easier way to achieve this?
Please note this is just one part of the form. The other part of form includes student details, comments etc. So ListView or GridView is not an option for me right now.
Thanks.
Regards,
I think ListView was a good choice here.
The ListView Control (Video).
ListView Web Server Control Overview.
However, refer to ASP.NET Data controls to get help in this issue.
Related
This is a example of what I am trying to archive
(source: http://store.apple.com/us/product/H7537LL/A/)
I need to display data (mostly text, also have picture and files) from database to a webpage (this could be a product information or a job description or something like that...), what the the appropriate control that developer often use I can use to archive this.
When inserting text (multi-lines) from a textbox to database table, HTML is not allowed so when I pull data out to display them again to the webpage, the break line characters were lost all I get is bunch of text without line break.
I am having a hard time to find the way to save and retrieve, display data, any advices or comments are appreciated.
As per your requirement you can use asp.net Repeater control
Please refer this LINK for more detail about Repeater control
The Repeater control is useful if you need a high degree of control over the generated HTML. Also see the DetailsView control. Here is MSDN documentation describing these controls.
Repeater
The Repeater control is a data-bound container control that produces a
list of individual items. You define the layout of individual items on
a web page using templates. When the page runs, the control repeats
the layout for each item in the data source. For information about
programming the Repeater control, see Repeater Class in the MSDN
library.
DetailsView
The DetailsView control gives you the ability to display, edit,
insert, or delete a single record at a time from its associated data
source. The DetailsView control displays only a single data record at
a time, even if its data source exposes multiple records. For
information about programming the DetailsView control, see DetailsView
Class in the MSDN library.
I'm adding a second answer based on your edited question.
The page like the Apple one you linked to (if it were written in ASP.NET) would be comprised of many different controls, so there isn't any one control that's going to work well for this situation. You're going to end up needing to create an entire page. For that, the only suggestion is to study basic ASP.NET Web Forms to create your page, then load the production information based on the product specified in the URL.
I am doing a project in which i am getting data from a database and displaying in asp:gridview. i want to show a hyperlink column in which i want to show a proper named hyperlink for example "View" and when the user click on "View" the data from the DataTextField property is displayed in detail on another page let say "WebForm1.aspx".i have searched on net and have studied on msdn bt couldnt get. detailed help will appreciated .. piece of code as example will be helpful . thanks in advance.
Example:
data in the database table
NewsID NewsTitle NewsArticle (NewArticle field contains large amount of data)
i want to show a proper link named("view"). when user click on the view ,NewsArticle of the related record should be displayed in a new separate webpage.
One way to do this is for the hyperlink/url contained in each row of the grid view to contain the id of the record you want to view the detail, i.e.
View
then in the page_load event of the webform1.aspx you retrieve that record from the database and dispaly it on the page.
There are lots of ways to skin this cat, this is a relatively simple one. The code below is what you might use to generated the html above:
<asp:HyperLinkField HeaderText="Name" DataTextField="Id" DataNavigateUrlFields="DetailId" DataNavigateUrlFormatString="WebForm1.aspx?ID={0}">
</asp:HyperLinkField>
If you are familiar with Jquery you can user Dialogs
http://jqueryui.com/dialog/
in my ASP.net web application i want load in dropdownlist box by category wise like below screenshot.. How can i do it??
I gonna use two table in DB
One is to Store Available Course
Second Table is Number of Degree like below
you can simplify using optGroup in dropdown...
please follow below link it might be useful for resolve your problem..
Group options for Asp.Net DropDownList
Enjoy coding....
I have a little problem in my form for entering some data for my users and that is a lot's of dropdowns, and i saw an a example of a dropdownlist where i can actualy type in it like in textbox and i get the options which contains my entered string.
To be more cleared, example is this: http://www.obout.com/mvc-combobox/autocomplete/aspnet_filtering.aspx
I have been using jquery autocomplete but that is not what i want in this case.
Any ideas or advices are welcome!
[EDIT]
Answer would be: http://tpeczek.com/2010/05/jquery-autocomplete-in-aspnet-mvc.html
With little modifications ofcourse!
All, I am creating a web application and I need to give users the ability to add/edit/delete records in a grid type control. I can't use 3rd party controls so I am restricted to just whats in the box for asp.net (datagrid or gridview) or creating my own. Any thoughts on the best direction to go in. I'd like to keep the complexity level at a dull roar :)
thanks in advance
daniel
You should definitely use edit and insert templates. All you have to do is give the button/link the command name such as insert/delete/update and you can allow the Grid to do most of all the work.
Check out this link
I think you'll learn to love the gridviews because they are pretty powerful.
Gridviews have different item templates that you can use for editing and inserting data. That'd be an easy way to go about it.
As long as you set your datakeyid property to the primary key in the database, you should be able to make template fields based off of whether or not you're editing or inserting data. The command name of the button you use to fire the event will handle the statements required for updating/inserting data.
This is a good site for some examples.
the out of the box grid is not too bad.
Here are a few links on master detail records in asp.net this should get you started on the CRUD opperations.
http://www.exforsys.com/tutorials/asp.net-2.0/displaying-master-detail-data-on-the-same-page.html http://msdn.microsoft.com/en-us/library/aa581796.aspx
http://www.bing.com/search?q=asp.net+master+detail
this is the best site for what you are after
www.Asp.Net
Data Access Tutorials controls
Master/Detail Using a Selectable
Master GridView with a Details
DetailView
Using TemplateFields in the GridView
Control
Others
Beginners Guide to the GridView
Control
The GridView Control
IN-DEPTH LOOK AT THE GRIDVIEW CONTROL