C# - Navigation Bar From Database
Apr 1, 2010
i want to make navigation bar with items i will select them as (category,Product,....) So i made stored to get them throught paramater will pass it,s value from query string as.
ALTER Proc Navcategory
(
@Category_Id Int
)
As
Select Distinct Categories.Category,Categories.Category_Id
From Categories
Where Category_Id=@Category_Id
and i mentioned in cs
as
if (Request.QueryString["Category_Id"] != null)
{
Banar.ImageUrl = "Handlers/Banner.ashx?Category_Id=" + Request.QueryString["Category_Id"] + "";
using
(SqlConnection conn = Connection.GetConnection())
{
SqlCommand cmd = new SqlCommand();........................
View 1 Replies
Similar Messages:
Jul 23, 2010
In classic ASP I would write some logic to get a nice menu on the site, but now with the Menu-control, it's as easy as it gets.. Maybe to easy. I can't quite figure out how I would do this.. I have a multilevel navigation structure (from a database) that I want to put into the Menu-control, but I don't know which approach is the best/easiest way for me..
I'm all into performance, usability and all that.. The only thing I have really decided is that I want to use the Menu-control, I haven't decided what datasource I should use or how to style the individual links my way The data is coming from a database and is not supposed to be changed very often (maybe once or twice every month).. Thought of making an XML-sitemap, but also of making some sort of SQL-hookup.. I'm leaning towards the XML-sitemap because it wouldn't take long to generate the XML every time the navigation changes and that won't happen very often. The next issue is styling, how to do that? I have the neccesary css ready for the individual links, but I'm still unsure of how to get it to the Menu-control.. The css I have looks like below and in its current form is intended just for the anchors
[Code]....
View 4 Replies
Mar 18, 2010
I'm using a custom sqlsitemapprovider to get my site hierarchy out of the database and display my navigation. Now, I have the following main (parent) nodes:
Home - Products - News. What I want to achieve is this, suppose you click on products then a subnavigation appears like this:
productGroup1,productGroup2, productGroup3.
But when you click products, no selection was made from the subnavigation, how would I achieve that if someone clicks on products, the
first product with content from the first productGroup1 shows up?
To visualize this: I click on Products -> Subnavigaton gets rendered -> PG1 - PG2 - PG3 -> page displays product1 of PG1
Is there as build in manner to accomplish this or how would one create a method to make this work?
P.S.:For my navigation, I'm not using any build in navigation controls, I'm rendering my menu as an html unordered list e.g: <ul><li></li></ul>
View 1 Replies
Aug 25, 2010
Iam using masterpage and i want to use navigation menu ,but i don't want to use sitemap concept
how to work with navigation menu and assign the pages in navigation menu in master page
View 2 Replies
May 19, 2010
I'm developing a Portal to a school
I need to login (ok)
I also need when the login is ok, to add some buttons to navigation menu, taht is created in the Master Page.
Is it possible?, how?
i already handle the page load on the default page.
View 3 Replies
Nov 8, 2010
I used below code in ASp.NET web forms code behined. Its passing parameter in the URL to which which page I am on so that I make HTML and add ON CLASS to show the page I am on.
How I solve this in MVC?. Any clean approach.
[Code]....
View 1 Replies
Jan 14, 2010
I will have a web site which include serveral functions for a training coudrse. For example,
1. Search the course
2 . Register the course.
What I want is to show the current status in the left pane of the browser. for example, if the user is searching the course, then in left pane "serach course" Will be highlighted. If the user is registering the course, then in left pane "registering course" will be highlighted.
View 3 Replies
Sep 13, 2010
I have a login module in my webpage from where i want to redirect every user to a common page but their accessibility should vary on the same page,..some of them should get 10 links on that page whilw some should get 20 links on the same page...
View 1 Replies
Jul 1, 2010
In the application i come to products.aspx from five different pages.I have back button on the products.aspx page.How find from which page user navigated to products.aspx
View 2 Replies
Jan 4, 2011
i've been looking everywhere to find a good tutorial on building a simple breadcrumb navigation for my application. I know that MVC 2.0 can do this very easily but for my application it needs to be in 1.0 as that is what is used at the University. Could anybody point me in the right direction as I seem to be spending way too much time for something that is supposed to be a simple add on.
View 1 Replies
Mar 22, 2010
I have a question for the navigation and I don't know how. For example when the users access the product page, on the top of the page it will display home > product, if the user access one product in the pens category, it will display home>product>pens.
View 6 Replies
Jan 27, 2010
Anyone know how to create a menu like the thegatesnotes.com ? Can we custamize the treeview control like that?
View 1 Replies
Jan 11, 2011
I am putting a navigation menu with in a div but the menu in aligned correctly. I want it to aling to top but it is being placed at the bottom.
Here is the script:
<%@ Master Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>Super Dream Mattress Co. </title>
<meta name="description" content="Super Dream Mattress Co. - Scorland only Memory Foam Mattress Manufacturer. We Manufacture Foam Toppers, Double Mattresses, Single Mattresses and Kingsize Mattresses. Free next day delivery on items, contact us online or call
0141 810 4333" />
<meta name="keywords" content="memory foam mattresses, memory foam toppers, memory foam double mattress, memory mattress, memory foam mattresses, Super Dream Mattress Co, Superdreammattressco" />
<script type="text/javascript" src="script.js"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->
<style type="text/css">
.newStyle1
{
font-family: Arial, Helvetica, sans-serif;
font-size: medium;
}
</style>
</head>
<body>
<div id="art-page-background-simple-gradient">
</div>
<form id="form1" runat="server">
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl">
</div>
<div class="art-Sheet-tr">
</div>
<div class="art-Sheet-bl">
</div>
<div class="art-Sheet-br">
</div>
<div class="art-Sheet-tc">
</div>
<div class="art-Sheet-bc">
</div>
<div class="art-Sheet-cl">
</div>
<div class="art-Sheet-cr">
</div>
<div class="art-Sheet-cc">
</div>
<div class="art-Sheet-body">
<div class="art-Header">
<div class="art-Header-png">
</div>
<div class="art-Header-jpeg">
</div>
<div class="art-Logo">
<h1 id="name-text" class="art-Logo-name">
<a href="~/Default.aspx">
Super Dream Mattress Co.</a></h1>
<div id="slogan-text" class="art-Logo-text">
Dreams in Comfort</div>
</div>
</div>
<div class="art-contentLayout">
<div class="art-sidebar1">
<div class="art-Block">
<div class="art-Block-body">
<div class="art-BlockHeader">
<div class="l">
</div>
<div class="r">
</div>
<div class="art-header-tag-icon">
<div class="t" >
Menu</div>
</div>
</div>
<div class="art-BlockContent"
<div class="art-BlockContent-body">
<div class="cleared" >
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"
StaticDisplayLevels="3" valign="top">
<StaticMenuItemStyle VerticalPadding="0px" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</div>
</div>
</div>
<div class="cleared">
</div>
</div>
</div>
<div class="art-Block">
<div class="art-Block-body">
<div class="art-BlockHeader">
<div class="l">
</div>
<div class="r">
</div>
<div class="art-he
<div class="t">
Highlights</div>
</div>
</div>
<div class="art-BlockContent">
<div class="art-BlockContent-body">
<div>
<p>
Super Dream Mattress Co. become members of the National Bed Federation.</p>
<p>
<img alt="Super Dream Mattress Co. become member of the NBF" class="style2"
src="images/nbf_logo.gif" align="middle"
style="z-index: auto" /></p>
<p>
<br />
</p>
</div>
</div>
</div>
</div>
</div>
<div class="art-Block">
<div class="art-Block-body">
<div class="art-BlockHeader">
<div class="l">
</div>
<div class="r">
</div>
<div class="art-header-tag-icon">
<div class="t">
Contact Info</div>
</div>
</div
<div class="art-BlockContent">
<div class="art-BlockContent-body">
<div>
<img alt="an image"
src="images/contact.jpg"
style="margin: 0pt auto; display: block; width: 95%;" />
<br />
<b>SuperDream Mattress Co.</b><br />
Unit 3a Pegasus Business Park<br />
Hillington, Glasgow<br />
Scotland, G52 4TY<br />
Email: <a href="mailto:sales@kayfoam.co.uk">sales@kayfoam.co.uk</a><br />
<br />
Phone: 0141 810 4333<br />
Fax: 0141 810 1423
</div>
<div class="cleared">
</div>
</div>
</div>
<div class="cleared">
</div>
</div>
</div>
</div>
<div class="art-content">
<div class="art-content">
<div class="art-Post-body">
<div class="art-Post-inner">
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
</div>
</div>
</div>
<div class="cleared"
</div>
<div class="art-Footer">
<div class="art-Footer-inner">
<a class="art-rss-tag-icon"
title="RSS"></a
<div class="art-Footer-text">
<p>
Contact Us</a> |
Terms of Use</a
Trademarks</a> |
Privacy Statement</a><br />
Copyright © 2011 ---. All Rights Reserved.</p>
</div>
</div>
<div class="art-Footer-background">
</div>
</div>
<div class="cleared
</div>
</div>
</div>
<div class="cleared">
</div>
<p class="art-page-footer">
Kayfoam</p>
</div>
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
View 2 Replies
Dec 4, 2010
I've been tasked with managing the re-write of a very large enterprise application's UI. The existing UI was built upon an infrastructure which leverages the EntLib 3's PageFlow application block and the Web Client Software Factory. It performs horribly - part of the reason we need this upgrade so badly.
The problem is that these pageflows are very complex, using extensive conditional page transitions. When editing a data form, selection of a single value can determine not only what page you will reach when you click "Next", but whether a sub-pageflow is entered upon navigation instead, or a new pageflow is opened in parallel, etc. We deploy our UI in such a way where we control our API, but we allow certain licenses to purchase our UI code and extend/modify it as they deem fit. One of our selling points is that we allow the customer to "configure" or redefine pageflows using the VS designer.
In transitioning to MVC2 (or 3), we'd like to continue to offer configurable, conditional navigation throughout our various data entry page sequences. However, although I have developed the beginnings of our app in MVC2, I'm not sure the best way of implementing this data-entry pageflow "conversion". Sure, I've had my resources produce some solid designs - but all of them seem to require implementation of a complex controllerfactory. But one of the main attractions of MVC2 for me was its lightweight codebase and resultant performance gains - and I'm afraid that bypassing portions of MVC2 functionality by writing custom factories and the like will drastically reduce the performance of the app, making our UI refresh virtually worthless.
My initial thought was to write a custom filter that would implement the OnActionExecuted method. Every controller's primary POST methods would be marked with this attribute. Upon execution it would evaluate what view the user was on and look up the navigation event for that view in configuration. This config would have a default "next page"/"previous page" mapping, and can also allow for defining a type which would use conditional logic to determine the next page based on the posted model data. The actionfilter would use this type to find what route to navigate to next. I'd like to pick you experts' brains on this - does this seem like a solid design? Is it using best practices? And will it indeed perform better than a controller factory, or am I completely off-base here?
View 3 Replies
Apr 10, 2010
I Made label to had value from database and linked it . but the problem was it had only one value and i want it keep value when navigation thought site as.
x>y>z>....
this is my code
<
if (Request.QueryString["Category_Id"] != null)
{
Banar.ImageUrl = "Handlers/Banner.ashx?Category_Id=" + Request.QueryString["Category_Id"] + "";
using
(SqlConnection conn = Connection.GetConnection())
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Navcategory";
cmd.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"]));
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
LblNavigaton.Visible = true;
LblNavigaton.Text = dr[i].ToString();
NavHref.HRef = "ListView.aspx?Category_Id=" + Request.QueryString["Category_Id"] + "";
}
}
}
else if (Request.QueryString["ProductCategory_Id"] != null)
{
Banar.ImageUrl = "Handlers/ProCatBanner.ashx?ProductCategory_Id=" + Request.QueryString["ProductCategory_Id"] + "";
using
(SqlConnection conn = Connection.GetConnection())
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "NavProductcategory";
cmd.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", Request.QueryString["ProductCategory_Id"]));
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
LblNavigaton.Visible = true;
LblNavigaton.Text = dr["Name"].ToString();
NavHref.HRef = "ListView.aspx?ProductCategory_Id=" + Request.QueryString["ProductCategory_Id"] + "";
}
else
{
LblNavigaton.Visible = true;
LblNavigaton.Text = Page.Title;
}
}
View 2 Replies
Jun 29, 2010
How I can Make Navigation bar in my site as A>E>D>S>H. I tried more to find an example also I searched more but I couldn't find particular example searched
View 2 Replies
Aug 5, 2010
I warking with EF 4 in vs 2010 with asp.net application.
In my page I put detailsview which connet to objectdatasource.
I want to bind navigate property to text in murkup like this:
<asp:TextBox
ID="txt_legalStatus"
runat="server"
Text='<%# Databinder.Eval(Container.DataItem,"legal_status_codes.Term")
%>'></asp:TextBox>
according to this article (from o'reilly book)
Using the Entity Framework in n-Tier ASP.NET Applications which write by julie lerman in section "Example 21.10. A TemplateField, which can be used for navigation properties".
When I run the application I get a Compilation Error "The name 'Databinder' does not exist in the current context" someone can tell me what my mistake?
View 4 Replies
Nov 17, 2010
My entity model was generated from the existing database. There is a many-to-many junction table picked up and hidden by EF.
The relationship is definitely working because this query returns 2 users as expected.
public IQueryable<User> FindUsersByGroupID(int group_id)
{
return db.Users.Where(u => u.Groups.Any(g => g.Group_ID == group_id));
}
But when locating a user that is part of the above result set the Groups navigation property count is 0. I shouldn't have to explicitly join.. right?
public User FindUserByID(int id)
{
return db.Users.First(u => u.User_ID == id);
}
View 1 Replies
Jan 16, 2010
[Code]....
I want to be able to make the first line blank, in this case "about us" and still keep the same dyamtic alignment on my nav menu. Right now, if i take the "about us" title text out, it messy up my dyamtic or on hover nav menu. What would be best is i can replace those letters with spaces but it won't work with just blanks. Any idea on how i would not display the "about us" but keep everything as is?
View 5 Replies
Feb 2, 2011
I use EF 4 and C #.
I need populate a Pure Junction Table (containing only FK to other tables) when an EntityDataSource _Inserted event is raised.
I have 3 Tables in my Database:
[code]....
Here a useful resource:
But I am not able to implment it:
[code]....
View 1 Replies
Jan 29, 2010
Is there a way to get ADO.NET Entity to generate 1:1 navigation properties? If I do foreign keys I always get 1:N navigation properties.
View 2 Replies
Oct 4, 2010
I am trying to strongly type a query for 3 ef objects using linq to sql. There are one-to-many relationships with product and category. My classes contain navigation properties and look like this.
public partial class Product
[Code].....
View 2 Replies
Mar 16, 2011
I'm very new to ASP.NET MVC and this is probably a really obvious thing...Basically, I can't access the "Forum" view which I had created inside "Home" folder (because I need a link to Forum on my main homepage.). I was wondering if it's okay to just move the Forum view into the Shared folder?
Is this somehow very bad practice? It seems like I have strong coupling now, because on the one hand the forum view gets called inside HomeController, and on the other hand it will pretty much always be used with ForumController from now on. So that might be unnecessary/wrong somehow?
edit: If I do this, the URLs change in a weird way, there must be a better solution right?
First when I click on forum link on main page, I'm at: /Home/Forum. I look at the forum, everything is fine.
Now I click on "Post a topic", and after the roundtrip I'm at /Forum/PostTopic.
View 1 Replies
Mar 31, 2011
am using c# with asp.net for wspproject. I am using spgridview to show the folders and files. When i clicked on folder, the spgridview bind with folder content(files/folders).Now i need to navigate folders based on the folder names like navigation bar in sharepoint.How to create the navigation bar for sharepoint folders?
View 1 Replies
Jul 11, 2010
I'd like to make navigation menu like one in [url=http://www.eveonline.com/]here[/url]. I thought about using TreeView, but I couldn't make "collapse" indicators to disapear. If I set ShowExpandCollapse property to "false" those indicators disapear, but tree becomes expanded and static. That's not what I want to achieve.
View 2 Replies