Can Block Cookies In IE8
Jul 20, 2010I configure IE8 to block cookies.
View 1 RepliesI configure IE8 to block cookies.
View 1 Repliescan cookies be blocked using a page directive instead of doing it programmatic?
View 4 RepliesI have menu item on my master page that has block around the text when the page is first run. I wrote in the css on the link and visited property to change the color to match the image color that it is on. When a menu item is clicked the color changes to the right color. How do I get it to the right color on when the page first opens or is there a way to get rid of the block or make it transperant?
View 1 RepliesI'm handling cookies using JavaScript to store some values in my asp.net web application.I use document.cookie to save some values (converted into a lengthy string). But i want that value to be accessible across all the pages in my application.When i try to get that value from a different page, i get the values pertaining to the document in the current URL.
In short i save the value in the cookie in http://myapp/doc1.aspx and want to retrieve it in http://myapp/doc2.aspx
So is document.cookie is pertaining to a single document scope? How can i save/read cookies across the site?
Update.This is how i get and set cookies
function getCookie(c_name)
{
try{ [code]...
But i'm getting different values for the cookies in different pages.
I have 2 separate code-block asp.Net expressions in an aspx markup, with an html content between (span element in the example below). In the first code-block, there is "i" as an increment variable for the for loop.Then the code-block is cut with an html content.And another code-block expression is opened but as I see I can reach the "i" variable which was declared in the previous code-block.
So, how asp.net handles -compiles- the pieces of code-block experrions declared in the mark up? Does it check the semi-colons and generates some anonymous methods which will end up with many calls to Response.Write in the last place?
<p>
<%for (int i = 0; i < 30; i++)
{
[code]....
I have been experimenting with code that will clear all of the cookies in an HttpContext.Response.Initially, I used this:
DateTime cookieExpires = DateTime.Now.AddDays(-1);
for (int i = 0; i < HttpContext.Request.Cookies.Count; i++)
{
HttpContext.Response.Cookies.Add(
new HttpCookie(HttpContext.Request.Cookies[i].Name, null) { Expires = cookieExpires });
}
this will error with an OutOfMemoryException because the for loop never exits - each time you add a cookie to the Response, it also gets added to the `Request.
I know that if I have set a cookie on a previous request, it will show up in my Request.Cookies collection. I want to update my existing Cookie. Are the cookies from my Request.Cookies collection already copied to my Response.Cookies collection? Do I need to add a new cookie with the same key using Response.Cookies.Add(), or do I need to use Response.Cookies.Set()?
View 1 RepliesIs it possible to use return statement in try block?.How,What is the use of the statement.
View 5 RepliesHow can I have my website block access to IE6? Redirecting it to a custom error page.
View 3 Repliesi have users who can logon to my site. I don't use the asp.net provider (i have my own user storage) but do use forms authentication. No i want to block users from log on twice to my app. Now what is the simplest thing to accomplish this? I thought about an extra field in the database in the user record but is there something simpler? is there a sort of 'session' for the entire application where i can remember who is logged on (and which is not flushed at a random time)? maybe in the cache (but the cache is sometimes flushed) i've seen an example where a file with the username was written to disk (and removed when logged out)
EDIT:
Good question was: what do you mean with logon twice. I mean when a user logs on on another computer or when another person logs on with the same credentials
I need to block one IP address or class in asp.net. help me with the code? And how to implement?
View 3 RepliesI want to print series in one cell of gridview sccording to condtiotion. I have used condition from ternary operator like
<%# Eval("Sequence").ToString()=="R" ? "Sequence1" : "Sequence2" %>
but i want to print series instead of string Sequence1 and Sequence2 by loop.
I intend to around existing code snippet (updating a Hashtable) with lock() block to prevent multiple threads (launched by ASP.NET web site) from simultaneously updating a Hashtable.
Bc this is first time I do in this measure, I need your advice on
Any performance overhead caution caused by lock() Any other issues you ever experienced similar to this scenarios.
how to block UI when postback from buttons in form or in updatepanel and show "processing...". after return postback unblock UI.may be jquery plugin?
View 1 RepliesI have a simple wcf service like this, with a test method which simply sleeps for 20 seconds and returns a value. I wrote a test page which uses jquery to call it 10 times in a row, and it appears to execute concurrently, with the client waiting 20 seconds and then getting results back from all of the services at about the same time.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall,ConcurrencyMode=ConcurrencyMode.Multiple,UseSynchronizationContext=false)]
public class AjaxTestWCFService : IAjaxTestWCFService
However if I set
aspNetCompatibilityEnabled="true"
in web.config then no matter what I do, with concurrencymode, usesynchronizationcontext or instance context mode, or even serviceThrottling config, it appears to execute each web service call sequentially, with it taking 2 minutes for all 10 requests to return!!
Now I realize that this may be because of session, but at least in ASMX services I was able to set enablesession to false. And in fact my web service method is not using session at all. So you may wonder, why use aspNetCompatibilityEnabled at all. Because I want to use ASP.net impersonation and forms authentication.
I even set
[ServiceContract(SessionMode=SessionMode.NotAllowed)]
So my question is, is this by design and how can I enable concurrent web service requests with ASP.net compatibility enabled?
I'm using asp.net membership provider. and I need to block user account in case if the user post spam. How can I accomplish it using build in features of the Membership Provider.Can I use IsLockedOut? If so how can i update it programmatically?
View 2 RepliesIs there any possiblilties where we can use to block the unwanted ads in a browser using asp.net??
View 1 RepliesIf ((intCustomerCount Mod intColumns = 0) And (intCustomerCount > intColumns)) Or (intCustomerCount = intColumns) Then
View 3 Replies[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] GetCompletionList(string prefixText, int count, string contextKey) {
// Create array of movies [code]..
Problem: The above code works great for me in getting the Autocomplete AJAX control to work. However, what I need is to define the string[] variable outside of the above block. What I'm looking for is the way to define such a variable as a global, or whatever the technical term in asp.net is for a variable that is persistent and recognized wherever it is used in the code-behind. without massive amounts of technical wizardry?
I'm new to ASP.net 3.5 and creating a test web site. I have created a master page for my web site with page content blocks. Now I want to use some javascript on the client side to provide for more interaction. I would normally create page specific Javascript functions and insert them in a <script block on the page. Howevere the Javascript script block must be placed before the <HTLM block. If I'm using Master Pages, it doesn't seem that I can use page specific Javascript functions. How can I resolve this problem? I think my options are
1) Don't use Javascript. Use ? instead to write client-side code.
2) Don't use Master Pages because you cannot use Page Specific Javascript functions.
3) Here's how to insert Javascript Functions in a Page with a Master Page.
I like to convert html for example a table to and image and save as jpg.(what I mean is that a table displayed on web page, I only want to get that specific table and save as image) Is it possible using asp.net?
View 4 RepliesI have tried this on two different controller methods now, and both times, even if the linq2sql doesn't allow the data to be saved, the code never jumps into the catch block.
I've watched the noun object in the middle of the trace, and the isvalid property is false, but the modelstate isvalid is true. Either way, the code never jumps into the catch block.I'm pulling my hair out about this. I feel like it will be something really silly.
The code all works similar to nerd dinner.
NounRepository nounRepository = new NounRepository();
Noun noun = new Noun();
try[code]...
I'd rather not have to add code in this manner though, as it seems like an unnecessary duplication.
I have to call the function, when exception occured. Is it possible to call the function in Catch block (Try-Catch)? I have tried it but the function did not get invoked. What i have to do for it? Shall we unable to call the functions in Catch block? I have shown my code below.
Try
Catch ex As Exception
ErrorHandlers.LogErrorDetails(ex, Session("UserId").ToString, "")
Throw ex
End Try.
I knew, We can invoke this function in Finally block but i do not need as per my requirements.
I have a table in a div which starts as invisible and by clicking a link it should be shown. The tables are in my aspx files while the div(s) are in the masterPage. This works just fine in FF but most of the time they do not show up in IE. If I manuallydo a refresh first then most of the time the div is shown.
<div id="drag" style="z-index: 5" >
<div>
<div>
script language="javascript" type="text/javascript">
var theSubject = '<%=Session["subject"]%>';
[code]...
<a id="rptQuestions_ctl01_hlQuestion" onclick="rptQuestions_ctl01_pnlAnswer.style.display = rptQuestions_ctl01_pnlAnswer.style.display == 'none'? 'block' : 'none';" href="javascript:">Header Link</a>
<div id="rptQuestions_ctl01_pnlAnswer" style="display:none;">
This works as i would expect in IE8, where it displays the div when you click the header link, and then hides it when clicking the header link again. However, in Firefox, nothing happens when i click the header link.I'm assuming this is to do with IE being forgiving of an error i have made, and Firefox sticking to the rules, but i can't see what i am doing wrong.