State Management :: Remove Querystring Key Items?
Dec 15, 2010How to remove querystring items? Dim currentUrl As String =[URL] Remove the querystring("link") key item and it's value? It will now become [URL]
View 4 RepliesHow to remove querystring items? Dim currentUrl As String =[URL] Remove the querystring("link") key item and it's value? It will now become [URL]
View 4 Replies[URL]
i want to get url without c=2, i want to get this
[URL]
is it possible?
I have a listview control, in it each item will have a checklist eg - Pass / Fail which will then have a label displaying the selected value. I also have datapager wired up to the listview.
When i toggle between the datapages and toggle back, any result previously submitted will be wiped.
I am thinking i should be using session state to temporarily store then info, and then once the session is finished use a submit button to send all values and ids into an xml.
1. Is this the right way of approaching the situation?
2. How would i specify session state for listview items, eg would i angle it through a itemdatabound event or the application itself?
I do not know that How to hide the querystring parameter from url in asp.net
View 5 RepliesI'm using Response.Redirect for empty QueryString.
[Code]....
I'm not sure if this is the best way to do this.
trying to pass a guid value to querystring - it should take the guid value from one page to another. i get an error: value cannot be null, parameter name: g. so my guid value is not being pass to my second page. below is code:
Page one:
static Guid g = Guid.Empty;
public static string userID = g.ToString();
string userName = string.Empty;
[code]...
My app has broken after upgrading to ASP.NET 2.0. The problem is that Request.QueryString is empty when the SelectedIndexChanged event of a IE Web Controls tab strip is fired. It worked perfectly in ASP.NET 1. I have the tab strip contained within my own UserControl.
View 3 RepliesI've a Linkbutton control in the master page. And in the content page(Home.aspx) i'm trying to navigate it an aspx page(Apply.aspx) passing a value using querystring. Everything is working fine when i click the apply linkbutton control for the first time i.e i'm able to get the value the querystring and able to use it.
But when i click on the same linkbutton second time, i'm not getting the querystring value?how to persist the querystring value on reloading?
I have trouble getting hold of the UserName from the QueryString. My data is not displayed on my page.
What is the problem with this code:
[Code]....
I have a aspx page and there is a web user control that must load dynamically with the data related to the aspx page....
ok so I want to use a querystring and pass it to the web user control.....how do I do this?
then also how do I pass a querystring from a web user control back to a aspx page?
This is a question I always had...and therefore never actually started to use the web user control
I am Caching dataset in my application, the issue is when there is a large set of data the OutOfMemory exception is thrown.
I want to check for the this exception and when it happens I want to remove the cache object.
If I change web.config or update dll files, all the current users in a web application lose their session and one may lost all their input.
How can I avoid this issue? How do you deal with this issue?
Which is best option to store confidential information in a page?Control,Session,QueryString etc ... ?And also the performance also should be good ... ?
View 11 RepliesOur IIS server (v7) has the following settings in [Custom HTTP Headers] for our whole site:
Pragma: no-cache Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0 X-Powered-By: ASP.NET
Out of the whole site, there are some pages that require the "no cache" setting to be removed for them to work properly. This was done manually by our IIS Administrator until recently. Now we were told that we need to do it programmatically on our end. The following were the code snippets (VB.NET) we have used with no luck in success.
Method-1
Response.Headers.Remove("Pragma")
Response.Headers.Remove("Cache-Control")
Response.Headers.Add("Cache-Control", "private")
Response.CacheControl = System.Web.HttpCacheability.public
Method-2
Response.ClearHeaders()
Response.Headers.Clear()
Response.CacheControl = "Public"
Response.Cache.SetCacheability(HttpCacheability.Public)
Response.Cache.SetAllowResponseInBrowserHistory(True)
i've a songs website, where i'm adding items to cart for users who are logged in, but when a song is deleted from the website the users still have the cart info still intact, i'd like the songs in the cart also too be deleted when the song from the website is gone, how may i accomplish this ?
View 1 RepliesI have an asp.net application consisting of two web pages and a web service. All components are part of the same project, i.e. I have a solution with only one project. The web service queries a server and fills the information it retrieves into container objects which are stored in the cache of the application. This done using the Cache.Insert method:
Context.Cache.Insert("DemoCacheEntryKey",
"DemoCacheEntryValue",
null,
Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration,
CacheItemPriority.Default, OnRemove);
OnRemove is my handler that writes the reason into the log file in case the item is removed from the cache. Now from what I understand this example item should never be automatically removed from the cache. Basically this is what I want: It shall stay in the cache until I explicitely remove it. Once the cache is populated by the web service one of the web pages visualizes the cache content using html. The other web site contains a button to manually kick on the web service and one button to clear the cache content, i.e. remove everything in the cache. Unfortunately somehow the cache seems to get cleaned up once in a while. In irregular intervals all containers that are created by the web service and are stored in the cache are removed from the cache. I don't understand the reason for this. The only place in the code I remove something from the cache is when I manually press the clean cache button on one of the web pages.
What is strange is that all container objects in the cache are removed, not just a few. But this is not because the button that cleans the cache is pressed. I know this because a log entry is created whenever that button is pressed. To find out what is going on I attached the OnRemove handler which just logs the reason why a cache item is removed. In my case the reason is "Removed". I simply don't get it. How can I ensure that the cache just stays as it is? Items placed in there shall just stay there. Nothing shall be cleaned up automatically.
i've been coding an asp.net site using VS2005 for about one month.
my site uses both application cache and session cache to save data.
the syntax i use for application cache is :
HttpApplicationState appState = Application;
appState["someKey"] = "somevalue";
and for session cache i use :
HttpContext.Current.Session["someKey"] = "Somevalue";
my site is deployed on three standalone servers - each server runs a diffrent instance of the site.
two of the servers work just fine, the third has a stange problem - and also has the least free memory space.
in this server items start dissapearing from both the session and application cache - note that i set no expiration date to the cache items.
does anyone know why this could happen?
seems to me there is perhaps some memory limit for cached items setting that i am missing.
I built an intranet application using code from this project (link and more details below):
Everything seemed to work during testing, but when multiple people are using the shopping cart, items show up across sessions.
For instance, if two orders are created at the same time, an item in Order 1 will show up in Order 2 by hitting the shopping cart refresh button.
Order 1 and Order 2 are two separate computers and being used by two different logins. Cookies are enabled in the browsers.
when an item is added like this: ShoppingCart.Instance.AddItem(arryProductId(i))
Should it not add that to a unique instance of the cart and nobody else be able to see these items?
We are getting ready to deploy this and this is a major issue. Any help would be greatly appreciated.
-=-=-=-=-
http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=423
An instance of the shopping cart is created like this:
If HttpContext.Current.Session("ASPNETShoppingCart") Is Nothing Then
Instance = New ShoppingCart()
Instance.Items = New List(Of CartItem)
HttpContext.Current.Session("ASPNETShoppingCart") = Instance
Else
Instance = CType(HttpContext.Current.Session("ASPNETShoppingCart"), ShoppingCart)
End If
When I insert items, they are added like so:
ShoppingCart.Instance.AddItem(arryProductId(i))
In a page (not default) I have:
Protected
Sub Page_Load(ByVal sender
As
Object,
ByVal e
As System.EventArgs)
Handles
Me.Load
Try
loginRep = BusinessLogic.SR.GetUserName("99999")
System.Web.HttpContext.Current.Items.Clear()
System.Web.HttpContext.Current.Items.Add("RepId",loginRep)
I don't any errors and when in the run in the immediate window:
? System.Web.HttpContext.Current.items("RepId") in the immediate window on THAT page I get the OBJECT.
Then I have a hyperlink with navigateurl to the next page "~/ActCnt.aspx"
On that page, ActCnt.aspx, when in the code I have:
Protected
Sub Page_Load(ByVal sender
As
Object,
ByVal e
As System.EventArgs)
Handles
Me.LoadIf
Not Page.IsPostBack
Then
Dim loginRep
As BusinessLogic.SalesRep = System.Web.HttpContext.Current.Items("RepId")
In the immediate window ? System.Web.HttpContext.Current.Items("RepId") returns a String that is equal to "RepId".
Even if I change it to not be an object, but a string I only get the Name "RepId" of the keypair. I have NEVER gotten the actual value.
I have a multiview inside an updatepanel. in one of the views, I save a value in a session object like this:
Session["xyz"] = "some string value";
Then I switch to another view and try to pick it up the value in a button's OnClick event:
string x = Session["xyz"].ToString();
But I get a null reference error. Debugging it shows that Session["xyz"] is indeed null, yet other Session variables are still there. Is there something special about Session and AJAX?
I am developing a new website and I have a very strange problem. Depending on a simple query string parameter value I have "Internet Explorer cannot display the webpage" or a correct page. Let me show a couple of examples:
This url works, and displays the value passed in the "data" parameter:
http://62.22.11.221/default.aspx?data=cppexample
But this url does not work and I don't really know why:
http://62.22.11.221/default.aspx?data=cpp%20example
I am busy building a shopping cart with cookies. I have datalist which I populate from the cookies with a delete button next to each cookie
[Code]....
Now the problem is that when I hit the delete / remove button to expire the cookie, what happens when repopulating the datalist is that it shows the original cookie with all it's values as well as a new entry where all the values are blank.
when we go for client and server side state management in asp.net
View 2 RepliesI want to remove Any added QueryString To Address after i get the variables. for example:
www.websiteName.com/page.aspx?a=344&b=233
i will get a and b and after that i want my address to look like this:
(www.websiteName.com) .
"root location".
I am doing a POC of making my website run faster. Currently it stores huge object data in Session while passing information from one page to another. What I was thinking is to use shared methods and properties instead of session. It works, but wanted tocheck if this is an optimum way to do it. Below is the code that does not use session but still pass object data from one page to another:
[code]...