Web Forms :: Refresh Menus On The MasterPage After ContentPage PostBack
Jul 15, 2010
We have a master page file in which we have a MenuControl. We are displaying some menus according to users credentials. We are handling MenuItemDataBound event inside master page for adding & removing menus.
There is user edit page{ContentPage} on which user may edit his own credentials. After saving the edited data {users credentials} by ASP.Net Button control, the MasterPage's MenuItemDataBound event doesn't fire (in case of refresh it is firing but in case of post back it is not firing).
We need to recreate/refresh MenuItems for master pages after saving the user and add/remove any nodes from Menus.
View 4 Replies
Similar Messages:
Feb 13, 2010
I have a masterpage with a timer that shows server time and refreshes every second, on the content page I have a chat program with ajax, refreshes every to second to get the last messages entered.
I have a Html TextBox and a hidden Submit Button, when user write a text, and hit the enter, I check to see if this is the enter key and then submit the message,it is working perfectly in IE, but in FireFox and Opera it show the same message twice. I think the problem is the Timer, is there any way to avoid the MasterPage timer in this particular content page?
View 1 Replies
Oct 24, 2010
I am trying to get value of a variable"offset" code behind of content page which is set from default.aspx through onload event from master page.But it gives null value every time. Here is my code.
Maste.aspx
---------
<head>
<asp:ContentPlaceHolder runat="server" id="Headers"> [code]....
View 10 Replies
Oct 7, 2010
I have a FreeTextBox control on a page that has a masterpage. This FreeTextBox control is in the maincontent.
View 5 Replies
Apr 24, 2010
I have applied my stylesheet in my masterpage the following way:
[Code]....
In my contentpage I wish to change the stylesheet of my masterpage, but I'm not sure how to reference to it.
I've tried the following, but I can't scope to the "test".
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
test.Href = "~/CSS/AlternativeMenu";
}
</script>
View 3 Replies
Aug 23, 2010
how to set the body class of a ContentPage when using master pages?
I want to set the body class so that certain elements of my page are styles differently from each other. e.g. Navigation links to so which is the current page.
View 4 Replies
Feb 10, 2010
Asp.net: Can we use MasterPage's viewstate in ContentPage ?
View 1 Replies
Jul 21, 2010
I have a unordered list in my master page....
<ul id="mainMenu" runat="server">
<li id="mainHome" runat="server"><a href="#" title="Home" class="home">
<span></span>Home</a></li>
<li id="mainManage" runat="server"><a href="Users.aspx" title="Manage"
class="manage"><span></span>Manage</a></li>
<li id="mainEnquiry" runat="server"><a href="account.aspx" title="Enquiry"
class="enquiry"><span></span>Enquiry</a></li>
<li id="mainReport" runat="server"><a href="EnquiryReport.aspx" title="Report"
class="report"><span></span>Report</a></li>
</ul>
From a content page i am assigning a css class to one of the list item.
HtmlGenericControl home = (HtmlGenericControl)this.Page.Master.FindControl("mainMenu").FindControl("mainManage") as HtmlGenericControl;
string cssToApply = "current";
if (null != home)
{
if (home.Attributes.ContainsKey("class"))
{
if (!home.Attributes["class"].Contains(cssToApply))
{
home.Attributes["class"] += " " + cssToApply;
}
}
else
{
home.Attributes.Add("class", cssToApply);
}
}
and my css,
#header ul li {
display:inline;
float:left;
}
#header ul a {
-x-system-font:none;
color:#FFFFFF;
display:block;
font-family:Trebuchet MS,Arial,sans-serif;
font-size:1.1em;
font-style:normal;
font-variant:normal;
font-weight:bold;
text-transform:uppercase;
text-decoration:none;
}
#header ul a {
-moz-border-radius:3px;
-webkit-border-radius:0.2em;
padding:3px 7px;
text-decoration:none;
}
#header ul a:focus, #header ul a:active, #header ul a:hover {
background-color:#829E7E;
outline-color:-moz-use-text-color;
outline-style:none;
outline-width:medium;
}
#header ul a.home {
margin:0 16px 0 17px;
}
#header ul #current a, #headermenu #current span{ /*currently selected tab*/
background-color: #BCE27F;
color:#666666;
white-space:nowrap;
}
#header ul a.manage,#header ul a.enquiry,#header ul a.report {
margin:0 14px 0 0;
}
#home #header ul a.home, #enquiry #header ul a.enquiry, #report #header ul a.report, #manage #header ul a.manage{
-moz-border-radius:3px;
-webkit-border-radius:0.2em;
background-color:#B9E27F;
color:#FFFFFF;
}
But i get the error, System.Web.UI.AttributeCollection' does not contain a definition for 'ContainsKey' and no extension method 'ContainsKey' accepting a first argument of type 'System.Web.UI.AttributeCollection' could be found (are you missing a using directive or an assembly reference?
View 1 Replies
Feb 27, 2011
I am using a Masterpage for my upload_photo.aspx which displays the file upload page using colorBox. However, ever since i added (code below) in the Masterpage colorBox doesn't display:
<script type="text/javascript">
$(function () {
$("#txtAutoCompleteSearch").AutoComplete("search.aspx?searchword=");
[code]...
View 1 Replies
Mar 27, 2011
I have a DateTime in my MasterPage.aspx that is outside of UpdatePanel1. There are two Hyperlink controls inside UpadatePanel1 to navigate or to move to the other pages. Full code of MasterPage.aspx is below.
[Code]....
If the user clicks Hyperlink to navigate or move to the other page, the DateTime will change. It means that my MasterPage.aspx render the whole page when the user clicks Hyperlink. I do not want this behavior. I want my MasterPage.aspx only render the ContentPage and the
Hyperlink inside UpadtePanel1. Controls outside UpadtePanel1 like DateTime should not be rendered again. Please advise the code to achieve my example goal.
View 2 Replies
Jun 16, 2010
some samples for designing the menus and sub menus in html with styles and hover etc
View 8 Replies
Sep 24, 2010
in one of my page i need to display the menus & sub menus dynamically,for this i have a menu table called colleges & one more table called branchs 1] ABC
Science ArtsCommarce2] EFG mathszoology historylike thissome times the menus are 3some times they may be 4,5,6 may randommy incresesfor this i have the two table one is menu & sub-menus
View 2 Replies
Feb 27, 2011
am new for learning asp.net using c
View 2 Replies
Jul 24, 2010
Anyone with similar conclusion? GridView does not databind/refresh upon postback unless the postback is called by itself?
View 1 Replies
Nov 22, 2010
is it possible to refresh the contentplaceholder of a masterpage only with ajax? I have a masterpage witch populates a treeview and a menu from a database. The treeview has links to created contentpages but when i click the node the whole page refreshes.
View 1 Replies
May 5, 2010
I have a masterpage with a checkout total for goods. WHen i add to the cart i press the button which adds to the cart but i want to refresh the checkout total on my masterpage.how can i do this on postback?if i change page the total updates fine
View 2 Replies
Oct 12, 2010
I've got a page with several gridviews that populate on page load. After user makes choices with radio buttons insid the gridview and presses submit I would liek the page to refresh and reload all gridviews.
postback page load loop and data doesn't get saved to the DB so I have to use If not Page.IsPostback then to avoid the loop.
After pressing submit, if I navigate to another page, then navigate back, I get the desired result I'm looking for a fresh reload.
how can I have the entire page reload fresh after the submit button is pressed? (it has to save data first then reload)
View 5 Replies
Oct 5, 2010
I've a DetailsView which I would like to pass an ID across to another page but cannot figure out how to do it!My ContenPlaceHolder is called MainContent, DetailsView is called DetailsView1This is what I have:
[Code]....
View 1 Replies
Nov 18, 2010
Probably a simple fix to this I am not sure. Basically, I have a MasterPage that contains a Dropdownlist. This DDL controls what is displayed in ContentPlaceHolder. However, when postbacks are caused within the Contact Pages the DDL is resetting itself. How can I keep the selected value for the DDL between postbacks?
View 3 Replies
May 5, 2010
I have an app that uses masterpages. On the masterPages I have a TreeView. I would like to only refresh the ContentPlaceHolder & not the Entire masterPage when a link is clicked on the treeView.
I have placed the contentplaceholder in an Updatepanel. I would like to if possible avoid including the menu in the update panel.
Using
VS2008 C#
AJAX Control toolkit Version 3.0.30512.20315
View 2 Replies
Jan 27, 2011
I have around 8 user controls on a page with a form in each of them. I have a dropdown list that allows you to select a form, with a selectedindexchanged event that hides the current form and shows the requested form.
There is some javascript that needs to fire when each form loads. Now, when you click on a form for the first time, the javascript fires as it should, but if you click the dropdown to change the form, then click back to a previous form, the javascript doesn't fire (because the user control is already loaded).
Is there anything I can do to trigger a postback, or reload/refresh the user control whenever an option is selected from the drop down?
View 12 Replies
Jun 5, 2010
I need to trigger a postback or self refresh a user control from one of the functions in the same user control.
Problem is that I am setting the selected value of a dropdown control in this usercontrol but it does not actually show up until after a postback.
This I came to know after I found that the said drop down shows the current value only after I click on another button.
I need to do this on the server side in the function given below:
public void FillDropDown()
{
FillProgramList(select);
//if (Request.Cookies["prgname"] != null)
//{......
View 5 Replies
Oct 23, 2013
I just want to know how to detect a page is refreshed or reloaded apart from Postback. Just clicking the reload button in the browser...
View 1 Replies
Apr 6, 2010
I have problem with user control: MyCollection : UserControl
MyCollection contains:
[code]....
Works fine unless I register event for some button:
button1.Click += ...
When click on button, nothing happens - page does postback, refresh but event handler method is not executed. Generated HTML is bit strange. Every page control has correctly generated ClientID including parent container ID.
Button in this collection MyCollection has odd ClientID - itemsAddresses$button1
View 3 Replies
May 3, 2010
There is a asp:Label in the page for showing message from server.
The message can be sent by server at any time.
I added a handler to update the Label's Text, like following:
void MessageReceived(object senders, EventArgsMessageReceived e)
{
lblMessage.Text = e.Message;
lblMessage.DataBind(); //To show the message
}
I am sure the break point of 'lblMessage.Text = e.Message;'' is hitted.
But the DataBind() seems not work, and the label isn't updated.
View 12 Replies