show previous data when switching between content pages - asp.net

I have a site with a master page and a number of content pages. I do a search for data in one page and then in another. Often the selected result from the first page should populate some of the search criteria in another. How can I switch back to the previous page and retain the search results?
I have the site working when the user controls are all applied to the one default.aspx page, but the page is just getting too big.
I use a Telerik RadTab with RadPageview in the single page and an asp ContentPlaceHolder in the master/content page.

I understand your problem. Having everything on one page means the search is remembered but your performance suffers. You want to change it to separate pages but still retain the search.
I've written a Navigation framework that will help you, http://navigation.codeplex.com/
In the documentation I build a sample web project that has a search page with a Hyperlink from each search result going to a details page. Then there is a link on the details page that goes back to the search page and retains all the searching (and paging) information and restores the search results exactly as before.
Let me know if you're interested and want any help with it.

Related

Is dynamic ASP.NET page data from database searchable by search engines?

I have an ASP.NET web app with an ASPX page that displays food item names and descriptions using a datagrid which I populate from a database during the OnPreRender event. The datagrid gets rendered as an HTML table. All of the data is automatically rendered. There are no query sting to parse.
Question:
Will the page be "crawled" so that the item names and descriptions are searchable from Google, etc.?
Short answer is – yes it will be.
What you can to is to go to google webmaster tools and use Fetch as Google option to see what Google will see when your page is accessed.
Just make sure that you always show the same content for the same URL. Google doesn’t like it when you show different content to different visitors using the same URL.

Create a new page in asp.net on button click

I'm trying to create a portfolio website where students can log in, choose from a selection of templates and then edit the content.
The users page is already set up but contains no html or asp.net.
I want to have it so that when the user selects the template and clicks the button, the code from that template is then written into their page.
Any ideas how I could do this?
Creating physical pages is not a good idea.
What you rather can do is to have your "pages" in the database and expose them through a url facade built on url rewriting.
A simplest example would be - you have a table, PAGES with Name and Body. Pages can be accessed with ShowPage.aspx?page=PageName. However, a facade exposes them as Pages/PageName.aspx which is internally rewritten into the ShowPage.aspx?page=PageName.
It doesn't really matter if you code agains WebForms or MVC, the general idea remains the same.

YetAnotherForum Customization - what ascx page being used for displaying forum topic?

YetAnotherForum 1.9.55 Customization , WindowsXpSp2
When user clicks on particular topic from the Last Forum Topic page or other page, he/she will be directed to details of topic(as below). I could not understand what ascx page being used for this page, I want to set Anonymous instead of User Name on this page(Topic details page).
I did post this query on YAF's customization forum but did not get any response so far.
YAFForumLink
The ascx page your looking for is DisplayPost.ascx, and it's in the controls folder, and in order to modify i guess that you have to change the code in the page source and not the code behind, and to give you a hint cause i have done a lot of customization, your best option in locating any page you want to to view the page source or use the "Inspect Element" option and try to locate a control id or a css class and search for it in the entire solution until you find what you want.

Restricting certain pages -- redirect on every page? Or on master page by viewing current page in url?

Per different user mode, some pages should not be accessible by users unless they have a valid session key.
In your opinions -- would it be better to have a list of acceptable pages in the master page, and check if the current page is valid for the current user? Or handle this on every child page?
I'm thinking master page, just want to hear what your input would be.
Thanks
The master page, or a defined base page, is the best place to put this kind of logic. The reason for this is that you are putting your filtering logic in one place. Copying cookie cutter code for each page will lead to problems down the road.
You should also make this logic as generic as possible, and store data that's going to change (your list of pages, your permissions, etc...) in the database. This will minimize code changes down the road when you want to add pages.
Finally, you need to define some sort of default behavior for pages that are not defined. Ideally, you would lock down pages that don't have permission data. This will ensure that you don't accidentally allow access to a page that needs to be restricted.
There are at least two cases that I see:
If there is one master page for all pages that you go to redirect, then use master page.
If there is one master page but the pages are not the same and not all pages of this master page are redirect but only some of them its is better to check this on current page and not on master page.
The reason is that if you place it on muster page, then you need to go throw a case list, and check on the master page in witch page you are. This takes more time and more memory and contain more risk to make errors if you create a page, then you change it etc. Also is difficult on the master page to know what page is the children and identified it.
On the current page you only need to check if your user can see it or not.

ASP.net webform design

I can't figure out a good design for this.
I have an edit product page. It allows you to change basic product details, product name etc.
Then I have a function to upload images of the product.
I also have a small page for adding different prices based on date ranges for the product.
What I can't figure out, is how to have these on the same page so as not to have a billion tiny pointless pages when I would much rather have them all on one page.
ASP.net webforms seems to only allow 1 form per page!
ASP.NET Webforms allows only one form per page, but you can create interesting UIs without hitch.
Here is an Open Source Codeplex Project ShoppingCart.NET, download it and check the Product Catalog CMS section. That will help you to learn the trick...
All the best
You don't need more than one form. You just hook up a button_click event for the different buttons on the page, such that only the relevant code is executed when the user clicks one of the buttons.

Resources