Web Forms :: SiteMap & Master Page: Set Session Variables And Dynamic URL's
Jul 6, 2010
I have a web application that contains a MasterPage and a Web.sitemap file for the navigation. I am loading the navigation into an <asp:Repeater> control and I associating it with <asp:LinkButton>; something like this:
[Code]....
I have two issues:
Setting Session Variables: I'd like to set some session variables when any menu item is clicked.Dynamic Url: Once the Session variables are set, I'd like to set the url dynamically after the Session variable is set The thing is, I'd like to use the same aspx file for two different menu items, and I'd also like to set some session variables at the time of menu selection. I am aware that I cannot use the same url when I define the url in the web.sitemap file.
View 2 Replies
Similar Messages:
Aug 17, 2010
I need to access a variable that is declared in a master page to a child page. I'm using asp.net 2.0 (vb). I'm sure this should be easy and is down to my inexperience with asp.net! A rough guide to my code is below;
MASTER PAGE
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<script runat="server">
Public UserNumber As Integer = 3
End Sub
</script>
CHILD PAGE
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
View 2 Replies
Jul 27, 2010
I am developing an application using Visual Studio 2010 and SQLServer 2008. My application has two pages and the first page contains a GridView with all the records "User Administration" and when user click on any Username (template field ->linkbutton) I read the USERID like this.
Session["UserID"] = e.commandArgument;
Response.Redirect("UserOperations.aspx");
which takes it to the Data Entry page where user updates the information and save the data.
The problem i am facing is that when I hit the browser REFRESH button couple of times the session variables looses the value which is trouble for me as I am using Session Variables for different purposes.
View 10 Replies
Apr 26, 2010
I have a very interesting problem about Sessions and Master Pages. I designed a small CRM web application with master page. Users could enter their expenses with this application. I put a label on master page. If users login to this site, I changed this label text.
Label text is username. My problem is; when some users using this site at same time, usernames are conflict. For example; One client login and label which on the masterpage value is Ali. Another client login and label value is Ahmet. After that, If two clients process the same things on this site, Ahmet's label's value is changed to the value of Ali. I write it Session Id on URL. Firstly two clients take different Session ID when login to that page. When conflict occurs, two clients are the same Session Id that pages. I am using .NET Framework 3.5V. Is this ASP.NET bug ?
View 13 Replies
Dec 1, 2010
I have a Master Page which controls the styling of my site. In the Code Behind, there are a few class instances instantiated as well as variables. These classes validate user access and then create user objects
I have a few Web Content Forms which carries out instructions based on the user objects. So far it seems that on each Web Content Form I have to create new instances of the classes found on the Master Page. This is doubling my work for every Web Content Form.
Is there anyway I can inhereit Classes and objects instantiated in the Master Page Code Behind?
View 2 Replies
Aug 17, 2010
I have an app which has a form that used to use AutoPostBack rigged controls (dropdowns, radiobuttons etc.) in an updatepanel, and I used to set session values on each postback. I posted the form using PostBackUrl to an external page, using a bit of javascript OnClientClick to copy my data into meaningfully named hidden fields.
Now, I've had to rewrite the AutoPostBack-ing controls so that all the cascading dropdown work and date calculation etc. is done in JavaScript, and not in C# - no more postbacks, no more updatepanel.
This means I've lost the ability to set my session values on postback. Can anyone think of a solution for setting these before I post my form? I need to set the session variables, plus post (querystrings are not an option) to the external page with the values from my form - and actually send the user to the external page, too.
View 2 Replies
Oct 10, 2010
I'm starting with ASP.NET MVC (1.0). I have a problem to resolve. I have developed a web applicaton (an application of articles like e-commerce) with a head (logo and menu). I have defined the head (logo and menu) in the Master page (site.master). Now, I must display the number of articles in the head in a field (like the number of articles in the virtual basket in the e-commerce). I can read the number of articles in the data base (in the controller), but i can't integrate it in the master page.
View 1 Replies
Jan 8, 2010
how do access master page variables from .aspx page
View 1 Replies
Dec 25, 2010
I'm trying to convert a game I made (WindowsFormApplication) to an ASP.NET page.
My Problem is that I have a lot "private" variables in my WindowFormApplication and those variables are important for the game. But when after I Declare all my variables (in my Page_Load), they turn null no matter what I do(click a button, refresh the page).
Is there anyway to save my variables between buttons (other than Session, because I'd have to create like 6 more sessions)
View 1 Replies
Aug 8, 2010
i am trying to collect 2 variables from one hyperlink, and use those variables in the page_load to set as session. but i don't know how to collect those 2 variables
such :
<a href="javascript:;" onclick="wsChangeColor('mainData', '#FF0000','#FFE4E1');return false;" title="Change color" id="red">1</a>
i would like to collect '#FF0000','#FFE4E1' or direct set '#FF0000','#FFE4E1' to string then send to pageload, how can i do this by only clicking on it ?
View 1 Replies
Jan 30, 2010
I have a simple SiteMapPath in my master page like below.
<asp:SiteMapPath ID="SiteMapPath1" runat="server" SkinID="SiteMap" Visible="true" /><br />
Also I use Web.sitemap and include all static sitemap pages. In my Web.config, I have this:
<siteMap enabled="true"/>
Currently, many pages uses this static site map for many projects and I'm not supposed to update the master page, but I need to have dynamic site map so that I can add query strings for each navigating pages.
View 2 Replies
Jan 16, 2011
I am using C#.
I am having below code in C#:
protected override void OnInit(EventArgs e)
{
try
{
if (Session["boolSignOn"].ToString() == "true".ToString())
{
lblPanelOpen.Text = Session["panelOpen"].ToString();
}
else
{
lblPanelOpen.Text = Session["panelOpen"].ToString();
}
}
catch (Exception ex)
{
Logger.Error("Error processing request:" + ex.Message);
}
}
protected override void OnLoad(EventArgs e)
{
try
{
if (!string.IsNullOrEmpty(Session["panelOpen"].ToString()))
{
lblPanelOpen.Text = string.Empty;
Session.Remove("panelOpen");
}
}
catch (Exception ex)
{
Logger.Error("Unable to remove the session variable:" + ex.Message);
}
}
In above code I am having a Session["panelOpen"] variable which is created from another user control and once my page is trying to render, I am storing Session["panelOpen"] in my hidden lblPanelOpen.Text on page OnInit() method, however when page is loaded completely then I am trying to remove the session variable.
View 4 Replies
Apr 22, 2010
I'm using the beta version of Visual Studio 2010. I'm running my ASP.NET 4.0 website through the debugger. Whenever there is a page load (e.g. clicking on a link, a postback) the session is ended and a new session is created. This wipes out all the session variables and makes debugging impossible. How to get session variables to persist across page loads?
Is this problem unique to running ASP.NET in a test environment or unique to the beta 2 version of VS 2010?
View 6 Replies
Apr 17, 2010
I have a masterpage in that i have few static control , tree and menu , i am generating the tree and menu dynamically , that works fine , after that when i chlick any node, the content page lode perfectly ...but the dynamic control in the master page ( tree and menu )disapper , but all the static control are there , what might be issue , i am generating the tree in master page load event ,
[Code]....
this is my code in page load event , i am using VS2005 , IE 8, windows XP
View 5 Replies
Sep 28, 2010
I have a site which has restricted access. Access is controlled via session variables.
There are a lot of pages to the site so I was going to check for the session variable via the page load event in my mater page. However, on certain pages I use the session variable in that pages page load event. This throws an error when the session doesn't exist, but what I want is the master page's page load to fire first.
View 2 Replies
May 12, 2010
I'm trying to set session variables in one page, and retrieve them in my code file in the page that it posts to.
I keep getting this error. I put the correct namespaces in, and enabledSessionState = true to my application files, but no luck.
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration.
I'm just calling a session variable, and I get that error
e.g,
Public AUID As Integer = Convert.ToInt16(Session("AUID"))
View 9 Replies
Jan 27, 2010
I need to make a sitemap with all the products i have in database.
I can make it easly in aspx web file, but is it better if i make it in Web.sitemap file? Would search engines find it?
And if is better to make it in Web.sitemap, how can i create siteMapNode for each product i have (and i add) in database?
View 12 Replies
Mar 1, 2010
I have an webforms app that loses it's session variables on response.redirect. I've read Bertrand Le Roy's blog about this and still can't get it to work. The page works in production. However, when I try in the VS2k8 IDE, the session variables are there right before response.redirect and on the first line of the next page, the variables are nothing. I've confirmed the session id is the same so I'm not skipping sessions. The target page is relative so the web server doesn't think we're changing sites (as confirmed by the sessionid).
Response.Redirect("menu.aspx", False)
View 1 Replies
Jun 25, 2010
I recently built a table dynamically on a page.
this is how I pulled the value back to fill in the text box in the table. With no master page.
TextBox tb = (TextBox)table.Rows[i].Cells[j].FindControl("TextBoxRow_" + i + "Col_" + j);
tb.Text = Request.Form["TextBoxRow_" + i + "Col_" + j];
Now that I've added a master page to this things apparently have gotten more complicated. This won't fill the value for the textbox in the table cell that I want. I know the value still exists because if I do this
Request.Form.GetValues("ctl00$MainContent$TextBoxRow_" + i + "Col_1")[0]
Has the value that I want to put into that text box. I know the text box gets created because it's there when the page refreshes. But I can't seem to find that text box so i can put a value in it.
View 7 Replies
Aug 23, 2010
I am creating Dynamic Checkboxlist controls and adding them to a Panel. It works well when I do
not have a Master Page configure to this webpage. Once I have a masterpage congifured.. I get a "Object Reference not set to instance of object" error on the Panel_Control.Controls.Add(Checkboxlistnew) line:
[Code]....
View 2 Replies
Jun 11, 2010
I would like to generate a dynamic sitemap to my website.It should be updated daily. Depends up on database user i have to generate.I am in initial stage of my website development.What are the things i have to take care. And how to develop a sitemap according to my requirement. I am using TeamSys 2008
View 3 Replies
Feb 22, 2010
Here is my web.sitemap code:
[Code]....
I wanna to show bread crumbs navigation like:
Home > Column1 > Content
the problem is: "~/Index.aspx" and "~/Column.aspx?ColumnId=1" are actual URLs and navigation bar: "Home > Column1" really works,
but "~/Content.aspx?ColumnId=1" is only the beginning part of actual dynamic URL, for example: it may be
~/Content.aspx?ColumnId=1&NewsId=12598 or ~/Content.aspx?ColumnId=1&NewsId=37215
all the previous Urls are articles of Column1 with same "~/Content.aspx?ColumnId=1" but are followed with different "&NewsId=number".
So, how can I realize this kind of navigation bar?
Home > Column1 > Content
View 3 Replies
May 25, 2010
How I can to Create a dynamic Google SiteMap in ASP.NET 2 or higher??
now I can to Create Static dynamic Google SiteMap.
View 1 Replies
Jun 3, 2010
i have a website that generates urls dynamicly.(?Department=1&Category=4&Page=2) then i rewrite the url to (Phone-d1/Sony-Ericsson-c4/)
I have hunderds of products so how do i create a sitemap for this, or should i doit only for the Departments, if so how would i do it.
View 2 Replies
Jun 28, 2010
I am adding text fields to a page from the database. I set the .ID to match the record ID from the database. Of course becasue the text field is on the masterpage, when I grab the .ClientID, it is ctl00 contentMain$ctl00. what I don't get is where is my ID? If I set it to say AB how do I find the textbox by AB? I thought it should have AB in the ID somewhere. ID is nothing which I don't get either. I'm looping through the controls in a placeholder like this
For Each row In dtData.Rows()
Dim c As Control
For Each c In phTextRequired.Controls
If c.UniqueID = row("CustomFieldID").ToString() Then
Again though what is in the row() is say AB but the id is way off from that.
View 4 Replies