Web Forms :: Show / Hide Submenu Based On Sql Tables With Existing Sitemap Method?
Feb 25, 2011
I am using asp.net2.0 , C#. I am binding menu control with sitemap to display menus and submenues. Which also restrict access and display of menu or submenu based on user's roles. I want to know Is it Possible to show/ Hide submenu based on sql tables with existing sitemap method
View 1 Replies
Similar Messages:
Jan 10, 2011
how to show submenu with sitemap in asp .net? where is wrong?
<asp:SiteMapDataSource ID="SiteMapDataSource1" StartingNodeOffset="-2" ShowStartingNode="false" StartFromCurrentNode="true" runat="server" />
<asp:Menu ID="Menu1" runat="server" BackColor="Transparent"
DataSourceID="SiteMapDataSource1" DynamicHorizontalOffset="2"
Orientation="Horizontal"
DynamicEnableDefaultPopOutImage="False"
StaticEnableDefaultPopOutImage="False"
EnableViewState="False"
staticdisplaylevel = "2"
dynamicdisplaylevel = "2"
Font-Names="Verdana" Font-Size="1.2em" ForeColor="#666666"
StaticSubMenuIndent="30px">
<StaticSelectedStyle BackColor="Transparent" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicHoverStyle BackColor="LimeGreen" ForeColor="White" />
<DynamicMenuStyle BackColor="#E3EAEB" />
<DynamicItemTemplate>
<%# Eval("Text") %>
</DynamicItemTemplate>
<DynamicSelectedStyle BackColor="#1C5E55" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticHoverStyle BackColor="LimeGreen" ForeColor="White" />
</asp:Menu>
<siteMapNode url="~/hello.aspx" title="Start" description="" >
<siteMapNode url="~/Default.aspx" title="Home" description="" />
<siteMapNode url="~/Daily_Transaction.aspx" title="Pay fee" description="" />
<siteMapNode url="~/EditCompanyMaster.aspx" title="Update Company Name" description="" />
<siteMapNode url="~/Report_Selection.aspx" title="Report" description="">
<siteMapNode url="~/DailyReport.aspx" title="Daily Report" description="" />
</siteMapNode>
</siteMapNode>
View 1 Replies
Oct 1, 2010
We have a dynamic sitemap and all nodes in the sitemap display a breadcrumb. Is it possible to have the breadcrumb still showing, but make the link in the sitemap invisible or non-clickable? Reason for this is that... we dont want users to select some pages from the sitemap (becasue they need to conduct a search first to populate a datagrid) and clicking on the link will only take them to an empty page. I tried just removing the url, or having a blank title, but that didn't work.
View 14 Replies
Jan 6, 2011
How to show menu with sitemap based on sql server data?
View 1 Replies
May 27, 2010
Whenever i add a exta submenu to:
<siteMapNode url="~/washroom/default.aspx" title="Washroom Supply" description="Washroom Supplies">
<siteMapNode url="~/washroom/example.aspx" title="Example" description="Example" />
</siteMapNode>
I get the error page.I managed to add one sub menu(example) but there is no way that I can add more. Everything looks ok but for some reason dosent work. That's the whole map:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns=[URL]
<siteMapNode url="/" title="Home" description="Home page">
<siteMapNode url="~/cleaning/default.aspx" title="Cleaning" description="Cleaning Services">
<siteMapNode url="~/cleaning/office.aspx" title="Office Cleaning" description="Office Cleaning" />
<siteMapNode url="~/cleaning/ceiling.aspx" title="Ceiling Cleaning" description="Ceiling Cleaning" />
<siteMapNode url="~/cleaning/awning.aspx" title="Awning and Canopies" description="Awning and Canopies" />
<siteMapNode url="~/cleaning/pubs.aspx" title="Pubs, Bars and Clubs" description="Pubs, Bars and Clubs" />
<siteMapNode url="~/cleaning/communal.aspx" title="Communal Areas" description="Communal Areas" />
<siteMapNode url="~/cleaning/carpet.aspx" title="Carpet and Upholstery" description="Carpet and Upholstery" />
<siteMapNode url="~/cleaning/window.aspx" title="Window Cleaning" description="Window Cleaning" />
<siteMapNode url="~/cleaning/pressure.aspx" title="Pressure Washing" description="Pressure Washing" />
</siteMapNode>
<siteMapNode url="~/distribution/default.aspx" title="Distribution" description="Distribution Services">
<siteMapNode url="~/distribution/price.aspx" title="Price Guide" description="Price Guide" />
<siteMapNode url="~/distribution/areas.aspx" title="Areas We Cover" description="Areas We Cover" />
<siteMapNode url="~/distribution/collection.aspx" title="Free Collection" description="Free Collection" />
</siteMapNode>
<siteMapNode url="~/office/default.aspx" title="Office Supply" description="Office Supplies" />
<siteMapNode url="~/washroom/default.aspx" title="Washroom Supply" description="Washroom Supplies">
<siteMapNode url="~/washroom/example.aspx" title="Example" description="Example" />
</siteMapNode>
</siteMapNode>
</siteMap>
View 7 Replies
Oct 26, 2010
I have the following line on my aspx page..
[Code]....
My issue is, that i only need this to display when my datalist is displayed and has records.. every time else, it needs to be hidden ( Visible = false ) on page_load i have it set to
btnAddVideo.Visible = false;
btnAddVidCart.Visible = false;
Should i only be check then within my dropdown event? By default the page is displaying my datalist, so it should be hidden.. then you have a dropdown to make a selection, if you change it, then it should show ONLY if there are records to be displayed.
View 12 Replies
May 22, 2012
i have passed a paramater to the report
if param="Y" then i want to display field2 else field 3
i tried that in expression as
=IIF(paramater!state.value="Y" , fields!add1.value,feilds!add2.value)
but i am not getting
View 1 Replies
Mar 20, 2013
I have a label , textbox ,and dropdownlist,in dropdown i have two items Accepted and Not Acceptedif i choose Not accepted it visible the label and textbox in vb.net.
View 1 Replies
Mar 24, 2014
I got requirement to create a accordion menu which will have different menus for different site collection.
So, i created this Accordion which is in bind with site map file. But my Sitemap file has multi-level nodes, here my accordion is displaying only single level menus.
View 1 Replies
Jul 16, 2010
I have an emergency request that I need to sort it out very quickly as I did not notice it early :(.
I have a dropdownlist, the contnet in the gridview (sqldatasource connection) changes based on the value the user slects, say I have play1, play2 from the dropdownlist, I would like to show column1, column2 and column3 with user selects play1; show column4, column5, and clomn6 when use selects play2; the datatable actually includes all 6 columns.
I understand that I need to use something like RowCreated event, and I need to set up condition based on the dropdownlist value, but I dont really know how to.
View 3 Replies
Oct 22, 2010
I have a form that has 2 querystring variables ID and FormID being passed to the page. Also on this page I have 2 different DataSources that outputs to a Detailview depending if the FormID is 1 or 2. I would like to be able to add a show/Hide command to Show only the DetailView that is selected and Hide the other. I have researched and found hat people are using a Multiview code, but I have not been able to find a working example code.
View 2 Replies
May 13, 2012
I have a tab container with 10 tabs each with unique id on a hyperlink click i need to make some tabs visible true false,in hyperlink I am passing a query string param
if the param="Y" param = Request.QueryString["type"];Â
if  (param == "Y") {Â
for (int tc = 0; tc <= TabContainer1.Tabs.Count - 1; tc++) {Â
if (TabContainer1.Tabs[tc].ID == "Y") {
TabContainer1.Tabs[tc].Visible = true;Â Â Â Â Â Â Â Â Â Â Â Â Â Â
}Â else {Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
TabContainer1.Tabs[tc].Visible = false:
}Â } }
I have the above condition but on this click the tab container is not at all visible but without any parameter passing the tab container is visible.
View 1 Replies
Sep 29, 2010
I have a textbox in a formview as well as a dropdown. When I select a value in the dropdown, the textbox should be made visible or invisible based on the value I select.
View 3 Replies
Mar 30, 2010
I am using VS2008.I am binding dynamic datatable to gridview. I have few dropdowns and textboxes in gridview.
I have dropdownlist(ddlTrCodeNw_)in gridview foooter template. Based on the selection of Trcode value few controls will be enabled,disabled,visible,hide. in gridview.
<asp:GridView ID="gvAPPost" runat="server" Width="100%" ShowFooter="true"
AllowPaging="true" AutoGenerateColumns="false"
onrowcommand="gvAPPost_RowCommand"
onrowdatabound="gvAPPost_RowDataBound"
>
<Columns>
<asp:TemplateField HeaderText="Discount %" Visible="false">
<FooterTemplate>
<asp:TextBox ID="txtDiscountPerNw" runat="server" Width="40px" Enabled="false" Visible="false" ></asp:TextBox >
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="txtDiscountPer" runat="server" Width="40px" Enabled="false" Visible="false"></asp:TextBox >
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Intially I set TemplateField HeaderText also Visible="false".
so i have written the condition in ddlTrCodeNw_SelectedIndexChanged.
Now when
if(ddlTrCodeNw.SelectedValue=="24")
{
txtDepstNw.Enabled = true;
txtDepstIncNw.Enabled = true;
txtCrdtNw.Enabled = false;
txtCrdtIncNw.Enabled = false;
lblDiscTrcodeNw.Visible = true; // I want to show this TemplateField HeaderText also when i need.
}
I can I show TemplateField HeaderText also whenever i need.
View 3 Replies
Mar 14, 2011
Well I have a web page asp.net(page1.aspx) amm user can choose two options A/B if user chooses a when he is in page2.aspx i want a javascript was execute
function(receive parameter)
{
}
But if he chose option B function never will be executed. I want to do, if user chooses A will see a asp button, but if he choose option b he is not going to be the button
View 2 Replies
Jan 1, 2014
I am making the asp.net application which consist of 6 form n based on user id pass want to show form e.g.: for admin all form appear for finance only 2 form appear when he enter his login id pass how can I?
View 1 Replies
Mar 12, 2010
I have a custom menu, which leverages the standard asp.net sitemap. It works well but some of my pages are dynamically generated by URL rewriter, so they don't sit in the sitemap XML file. At the moment I rolled a custom solution which shows/hides menu items via CSS class and a programmatic check of the role that the user is in. It works ok until I visit a dynamic page that doesn't exist in the sitemap file. I've tried the "roles" attribute in the sitemap file with security trimming but it isn't working because I have a custom menu.
Is there a way I could leverage the roles attribute in the sitemap file to show/hide menu items for my custom control below, even when some pages are not in the sitemap? My menu control is below...
<div class="menu">
<ul>
<asp:Repeater ID="rpt" runat="server" DataSourceID="smdsMenuPrimary"
EnableViewState="False">
<ItemTemplate>
<li class="<%#GetDisplayClass((SiteMapNode)Container.DataItem)%>"><a href='<%# ((SiteMapNode)Container.DataItem).Url %>'><%# ((SiteMapNode)Container.DataItem).Title %></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
View 1 Replies
Jun 15, 2010
I have following criteria in my gridview control.I have a parent gridview control (gvParent) which has 8columns in it. and i have gvchild within gvParent.And i want to show/hide the (gvChild) based on some condition in rowdatabound event of the gvParent. i need to display the child grid at the end of each row in gvParent .Also Child Grid should start from 3 rd column of the gvParent and should end at 8th column.How to bring the child grid after each row ?
View 2 Replies
Apr 10, 2014
i have 4 comboxes (com1, com2, com3,com4) and 4 tables (tab1, tab2, tab3, tab4)com1 and tab 1 have master table relationships i.e when in com1 the name is entered tab 1 shows the result of that entry. the same is for the rest comboxes and tables.
Now what i am trying to do is when an user clickes on com1 and types the name of the employee tab2 tab 3 and tab 4 should be hidden. if com2 is clicked tab1 and tab3, ta4 shoud be hidden.etc
Currenty i am using this code which i do not like. Is there any easy and short way to do hide an show.
this is the code i am using
<script type="text/javascript">
$("#com1").on('click', function () {
$("#div1").fadeIn();
[Code]....
View 1 Replies
Nov 22, 2015
I am adding two button in gridview here I populate gridview on page load this work fine problem is that  when my status value are  check  or peending then my two button are show.
But I want when my status value are check then check  button should be hide
And view button show in which row where staus value  are check But when my status value are peending here show check button and view button should be hide. I want follwing type .
Gridview Like that on page load
id name class status
1 imran 5 check
Hide Check button
View Button Show
2 ali 8 pending
Check  Button Show
View Button Hide
3 farooq 7 check
Hide Check button
View Button Show
How to do it following my code.
Default.Aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
populategridview();
}
public void populategridview()
{
string strConnString = "Data Source=.SQLEXPRESS;Integrated Security=SSPI;
[Code] .....
View 1 Replies
Dec 14, 2013
Below is House_info table
id name behcode
1 Neda 1111
2 Jack 2222
3 Sara 3333
House_p table
id Product behcode
1 sofa 1111
2 iron 1111
3 scarf 2222
and below is SP
ALTER procedure [dbo].[storeinfo1]
@Behcode nvarchar(10)
as
begin
select behcode,Name
,(select Behcode from House_p where BehCode=@Behcode) behcodeP
from House_Info
where BehCode=@Behcode
end
I have image=>Productimage in product.aspx page I want if in House_p table there be my users behcode it do Productimage.visible=trueÂ
i.e
In House_info table exist user Sara with behcode=3333  her behcode  isn't in House_p table so I want in product.aspx page ProductImage.visible=true
How I can do it?
View 1 Replies
Oct 6, 2010
I have a horizantal menu that has 3 items.Home Solutions Contact DatabaseSoftwareTechnical SupportAs you can see when you hover over Solutions it displays 3 submenu items.Beneath this menu, I have a JavaScript Slide Show.The problem is when you hover over Solutions it displays only the first 2 submenu items, the 3rd one (Technical Support) is chopped off by the JavaScript Slide ShowI have tried this in IE & FireFox and the same problem occurs.Can anyone please assist me in why the JavaScript Slide Show makes the sub menu items dissappear?
View 11 Replies
May 7, 2015
This is my Code
My query is if i select Other in dropdownlist i want visible textbox..
how to i do it..
<asp:GridView ID="TypeFruit" runat="server">
<Columns>
<asp:TemplateField HeaderText="Type" >
<ItemTemplate>
<asp:DropDownList ID="ddlfruit" runat="server" >
<asp:ListItem Value="0">Select</asp:ListItem>
<asp:ListItem Value="1">Fruit</asp:ListItem>
<asp:ListItem Value="2">Other</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TxtOther" runat="server" Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>Â
View 1 Replies
May 7, 2015
Actually I have a datalist in which I am binding product name and product description and there is a hyperlink.
I am binding datalist in page load and checking that user is login or not using session.
if user is login then hyperlink text should be view more
else
hyperlink text should be login to viewÂ
The code I have written is working fine but when user is logged in then Only one products hyperlink text changing. I want change it to all hyperlink text to view more when user login
View 1 Replies
Sep 2, 2010
I need to develop an easy and quickly to build menu structure based on xml. The menu needs to have a "Main" menu at top of the screen and a submenu at the left of the screen. Excactly like this: [URL] where i need to get started and wich control i should use?
View 1 Replies