I have an ASP.NET web application that I am making and I am thinking of making it a tabbed interface using Telerik's RadTabStrip. I am trying to figure out the best way to approach this though. I would need about 10 tabs because I have about 10 different main areas of my application. My question is how is the best way to integrate the content into the tabs. All of the simple examples I've seen create RadViews with imbedded HTML/ASP.NET content. The problem with this approach is that, with 10 tabs, it would make my main ASPX file really really big and it would be kind of clumsy to work with, having to integrate all 10 pages into one page. Is there a better or more accepted way to accomplish this?
I think, you have several possibilities:
Use one RadTabStrip and several RadView controls. Put the content for each tab into a separate user control (*.ascx). Then you only have to include the user controls in your main aspx page.
Use a master page and put the RadTabStrip on it. Create a separate page for each area of your application (each using the same master page). Use the RadTab's NavigateUrl property to navigate to the corresponding page (as shown in this demo).
there are certainly other possibilities...
Related
I am trying to build an Admin page that already uses the same Master the rest of my site does. Within this Admin page, I have a sidebar with links for different things that an Admin user needs to do. I want those links to load HTML/Razor content in the center of the page but I want to not make separate Admin pages for each bit of functionality.
What strategy or process would work best for this situation? Every search result I'm finding seems to be just learning about how to make a simple Master, but I don't want to make multiple Masters for my site.
(I'm very new to all this, but I learn fast from examples and references.)
There are many ways to solve this problem from dynamically change the UI by fetching from server through Ajax calls to Simple tabs.
As you said you are new to this you can use tabs
I've been working on a project and I noticed I reuse the same menu over and over again and it got to a point where, if I needed to change something I would need to change 20+ pages too because of it being a menu.
My question is, is it possible to have a single aspx file with the working menu on it, and have the other pages call it? So far I've tried
<?php include('Menu.aspx') ?>
<iframe id="myIframe" src="Menu.aspx" height="100%" width="100%"></iframe>
The later (iframe) showed something but I was unable to resize it and the links didn't work either. The php one didn't show anything. Any help would be appreciated, thank you very much.
You can use the following approaches to solve this:
Master Pages allow to have a common layout that is applied to several aspx pages. The master page defines a layout and provides some content placeholders that are filled in by the pages that reference the master page. Your example of a menu fits good; the menu would be placed on the master page. See this link for details.
Another way to share layouts are ASP.NET UserControls. These are created as ascx files and can be reused in several aspx pages. See this link for details.
The best option for you is to create an User Control, and use it in all your pages.
An user control is similar to a server control (e.g. asp textbox, update panel etc.), but custom made by the developer to suit his specific needs.
If the menu is more like the common layout/theme of all your pages you can use a Master Page instead.
You have to make yourself familiar with master pages. See this as a beginner tutorial: http://www.codeproject.com/Articles/333650/Beginner-s-Tutorial-on-Master-Pages-in-ASP-NET
There are two option to reuse menu in asp.net page.
Master Page
User Control
using sitemap and add into master page.
https://msdn.microsoft.com/en-us/library/aa581781.aspx
http://webproject.scottgu.com/CSharp/MasterPages/MasterPages.aspx
Hope this will help you.
thanks
I got multiple pages (not all) with the same functionality (a control for send Contact info) even for Dekstop and Mobile websites.
I want to create just one control and declare it as something like: "<asp:MySendInfo />" wherever I want to display all the TextBoxes, Lables, load events, etc, etc; that compose the hole functionality.
I can't use iframes or a masterpage.
As a comment from Yuriy above says, you are looking for User Controls (they usually have an .ascx extension). They work pretty much the same as ASP.NET Pages (.aspx).
For a quick start this is how you add them to your project and how you register and call them in your page.
I am creating a web application C# asp.net . I have a simple menu but I do no know if using
iframes to show different options according to the menu is better than using a masterpage.
I am pretty new at this. I read that iframes are not being used anymore.
Is there any other option that I can use?
Thanks
Yeah, I wouldn't use iframes in that context. At one point they were used to give the impression of something akin to Ajax, but you'll really only find them used these days for embedding videos, audio, etc. from other sites (e.g. YouTube, Soundcloud). Master pages should suffice - you'll have a master page with the menu itself, and any menu selection will load an entirely different page, albeit with the same menu provided by the master page. If you're looking to provide navigation without an entire page refresh, then you're getting into the realm of SPAs (single page applications), which will require the use of Ajax.
I am working on an asp.net project which has numerous form screens. All our forms are pretty much using a given set layout which needs to be made by developers ond an on again.
Our current implementation requires that for every form control, a developers needs to write inside in the .aspx file the HTML of our forms (whilst embedding our field controls in them).
As a result, we have our project's HTML code scattered in many, many controls all over the place. It is highly possible that we change the HTML of our forms in the future.
Does asp.net C# have anything similar to Drupal's Form API which allows developers to simply create their forms programatically using a "Form Control" of some sort? The developer would add 'rows' with different field controls in them. It is then upto the 'Form Control' to generate the HTML structure of the form in the end.
Using such a method should give me the following benefits:
HTML is all in one place - making it easy to change and even skin differently
Developers who are not HTML+CSS savvy do not need to tinker out of their comfort zone
Fast development of new forms
I had a look online and it looks to me that maybe what I am after is a Hybrid Table Control that is modified to generate Div's (and not necessarily table tags).
Any ideas?
I would:
create a master page for the whole web application
create a nested master page for the pages where these data controls appear
put all necessary CSS, html etc in these master pages
create a 'template control' for developers to follow, where they just need to drop items onto a new control.