How To Create A FAQ Page In .net Which Comprises A List Of 20 Questions
Jan 19, 2011
Have to create an FAQ page in ASP.net which comprises a list of 20 questions (all anchors) and then a Q/A section ftr down the page. The summary questions should jump to the Q/A section. I have the 20 questions in a List<> and have spun through the list creating a new List<> by adding <A></A> etc.
I am building a usercontrol which can display data with many flags. I would like to be able to able to declare it this way, or something similar to that from the asp.net page
I need some explanations regarding the above exception.
I understood that if you place a response.redirect inside a try catch block, u will get the exception and the aspnet will handle the exception silently without the user knowing. But the thing is that right now i am having a hard time thinking of a reason why the error will occur after some changes has been made and the codes with the response.redirect has not been touched.
The default asp membership provider only allows for one security question and answer. Does anyone know a work around to allow for more than one question and answer?
how to do this.or is there any template that one can use for the following-
using visual studio to design questions and answers with outcome of the grade immediately after submition and with timing.
For example, having questions 1 to 10, providing options like A, B, C,D, then let students choose from the right answer from the questions, then, after submition, an outcome of grade is displayed based on the right answer.
In my project I have a web service that returns an Exam object. This object contains a property that returns set of multiple choice questions in Questions[] array. Each Question object in Questions array contains two properties, Question and ChoiceArray. To clear things here's the code,
I need to know a way I can all of these question and their choices onto a form. Since I have these as arrays I can not bind them properly using DataList. how to display these questions and their choices on to the form and on choice selection, get the value of the selected answer for each question back.
I have created one exam module where user will give the answers of objective questions.I have created next buttoon now i am getting first question in form load and now on click of next button shall i increase the question no +1 or some thing else.
i am new for asp.net. i want to develop a simple web application(asp.net+c#) which display questions and multiple choice answers and calculate result. i want to know which one is the best way for me to do it.i want to use linq to sql.
I'm having troubles remembering how to grab the list view's state, or page, so that when you leave the list, you can return to the list view page you left on. I have a data pager, and I have hyplerlinks for items in the list view that take you to a file upload or file delete page, and then returns to the list view. It returns to the list view's initial state (first page).
I want to build a survey system where you can build a form with questions and some answers to these questions and then members who will log in will be able to take the test.
Then i want to present the different results from the test in some diagram or something like that.
Object reference not set to an instance of an objectI am getting this error sometimes. I have a page where I load questions and for some question system generate this error. Why do I get this error?
My question is, is there any benefit to instantiating a new userDetails object in every loop, or can this be created outside the loop and title, forename and surname just written over with every pass of the loop?
How would i create a details view that also contains a list?
My aim is to have a details view that displays information about a person and then have a list on the same page that displays facts about that person.
Currently, my details view is working fine. I just need to add the list part. The details view inherits Models.MyViewModel which is a custom class as the details come from multiple tables.
I'm having hard time understanding the following C# code. This code was taken from Pro ASP.NET MVC 2 Framework by Steven Sanderson. The code esentially creates URLs based on a list of categories. Here's the code:
A lot of stuff is going on here. I'm guessing it's defining a function that expects two parameters of type string, and NavLink. Then I see the Lambda categoryName => new NavLink etc.... I think all it's doing is creating an instance of NavLink. The function is then called in the same Controller action:
// Place home link on top List<NavLink> navLinks = new List<NavLink>(); navLinks.Add(makeLink(null)); // Add link for each distinct category var categories = productsRepository.Products.Select(x => x.Category.Name); foreach (string categoryName in categories.Distinct().OrderBy(x => x)) navLinks.Add(makeLink(categoryName));
I can tell that it's making a list of NavLink. I don't understand why Steven Sanderson wrote it this way though. Couldn't he have written something like:
var categories = productsRepository.Products.Select(x => x.Category.Name); foreach (string categoryName in categories.Distinct().OrderBy(x => x)) { var newlink = new Navlink{ text = categoryName, RouteValues = new RouteValueDictionary(new { controller = "Products", action = "List", category = categoryName, page = 1 }), IsSelected = (categoryName == currentCategory) } navLinks.Add(newlink); }
Is there an advantage to doing it Steven's way versus my way?
how to make a list of titles of news contained in a database. And in this list, each of the titles when clicked is redirected to a page where you will be able to view the news in full (Title, Body, Author ..). What I got:
- A database containing a table with the news, every news is associated with an identification code (ex: "ID").
- A page where you will make the listing. (Ex: site / listofnews.aspx)
- I have a page that uses the method "querystring" to know what is the primarykey the news. (Ex: site/shownews.aspx?ID=12345, where "12345" is the primarykey of the news. Once it knows what is the primarykey of the news in the database, it loads each of the fields of the page (news.aspx) with the news, this part is working ok.
- The data is retrieve using the Linq, so I receive a List of "News", the class "News" as ID, Title, Body, Author..
how to make the listing clickable.
In php I used this method (make a list of html links, in each link the href field is changed so that the tag "id" coincides with the news):
//database used is oracle, $stmt is the query, you donīt need to understand how it works. oci_define_by_name($stmt, "ID", $id); oci_define_by_name($stmt, "TITLE", $title); if (!oci_execute($stmt, OCI_DEFAULT)) {........
I am trying to get some values from a List and then create a html table with this data but I can't get it to work properly.
I have:
HtmlTable table = new HtmlTable(); HtmlTableRow row; HtmlTableCell cell; foreach(var item in Name) { row = new HtmlTableRow(); foreach(var familyName in item.familyName) { cell = new HtmlTableCell(); cell.InnerText = item.familyName.ToString(); row.Cells.Add(cell); } foreach (var givenName in item.givenName) { cell = new HtmlTableCell(); cell.InnerText = item.givenName.ToString(); row.Cells.Add(cell); } table.Rows.Add(row); } this.Controls.Add(table);
When I step through the debugger I can see that row.Cells.Add(cell) contains the family name in the first loop and given name in the second loop but then something seems to be wrong and I can't get the table to show up on the page with this data.
When I check the table.rows.add(row) it says that "base {System.SystemException} = {"'HtmlTableRow' does not support the InnerText property."}"
How to create create variables/properties in master page, and let sub-pages access them? So my master will have a string property HomeUrl How can any page that uses the master page access this property?
I'm currently in the process of creating a webshop. This webshop supports theming, but I also want customers to choose a lay-out. I can create multiple masterpages and create a handler to dynamically set the correct master page. But some components, like the shopping cart, are controls which have to be present in the master page and are also used in the aspx pages. The shopping cart control for instance, has an Update method which is called whenever the user adds a product to their cart. So the question is: can I somehow create a default masterpage which has all the components on it, but still be able to create multiple lay-outs. And how should I reference that master page from the aspx pages? I also thought of creating an Interface class which defines the masterpage and it's public components, but I don't know if I can reference an interface from aspx pages.