CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #5
    Join Date
    Jan 2005
    Posts
    35

    Smile Re: Web Response sent to wrong Client

    Your absolutely correct:

    I was trying to find the solution to this problem in the Code behind (C# code). I stumbled on another discussion which indicated that the default response of programmers is to look at the code, not the xml.

    First suspecting the session ID was not being honoured I changed the configuration to display the Session ID in the query string. This indicated that the Session ID was being honoured. I then started to work through the XML attributes, and when checking the documentation of the OutputCache directive thougth that caching on the server side (which is what this does, apparently) would not be a good thing if two users hit the server concurrently.

    I removed the line indicated below and the problem disappeared.

    Possible implications of removing this tag: unknown - maybe it will only mean the application works. If it breaks again I will post here.

    What interested me most, is this code was autogenerated. I did not put it there (I had no idea what it did) so it was never on my radar.

    Cheers
    Wee!

    Code follows:

    Main Page
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" EnableViewState="true" CodeFile="Quickpage.aspx.cs" Inherits="_Default" %>
    <%@ Register Src="Paging.ascx" TagName="Paging" TagPrefix="uc1" %>
    
    <!-- Removed this line - No idea if there are any implications to this or not
    <%@ OutputCache Duration="1" VaryByParam="None" %>
    < --
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server" >
        <title>Quickpage</title>
         <link  rel="SHORTCUT ICON" href="Images/pager.ico" />
        <link href="Style\StyleSheet.css" rel="stylesheet" type="text/css" />
        <script language="javascript" type="text/javascript">
        function fieldLengthCheck(fieldName, strValue, maxLength) {
    	    //Determines how long a string is and prevents the user entering any more characters once max length characters is reached.
        	
    	    spanCounter.innerText = strValue.length;
    	    if (strValue.length > maxLength)
    	    {
    	        var str = fieldName.value;
    	        fieldName.blur();
    	        fieldName.value = str.substr(0,100);
    	        strValue = fieldName.value;
    	        spanCounter.innerText = strValue.length;
    	        fieldName.focus();
    	     }
        }   
        </script>
    </head>
    <body id="body">
        <form id="form2" runat="server">
        <asp:ScriptManager ID="ScriptManager2" runat="server" />
        <div class="title"><img src="Images/QuickPage.BMP" alt="Quickpage"/></div>
    
        <uc1:Paging ID="Paging1" runat="server" />
            &nbsp;
        
        </form>
    </body>
    </html>
    Components Paging.aspx

    Code:
    <%@ Control Language="C#" AutoEventWireup="true" EnableViewState="true" CodeFile="Paging.ascx.cs" Inherits="Components_Paging" %>
    <%@ Register Src="UserLogin.ascx" TagName="UserLogin" TagPrefix="uc2" %>
    
    <asp:UpdatePanel ID="Paging" runat="server" >
    <ContentTemplate>
    
    &nbsp;<asp:Label ID="lblSearch" runat="server" CssClass="lblSearch" Text="Find:"></asp:Label>
    <asp:TextBox ID="txtSearch" runat="server" CssClass="txtSearch" TabIndex="1" ></asp:TextBox>
    
    <asp:Button ID="btnSearch" runat="server" CssClass="btnSearch" OnClick="btnSearch_Click"
        Text="Find" TabIndex="2" />
    <asp:Label ID="lblSearchResults" runat="server" CssClass="lblSearchResults" Text="Click to select:"></asp:Label>
    <asp:ListBox ID="SearchResults" runat="server" CssClass="SearchResults"  OnSelectedIndexChanged="SearchResults_SelectedIndexChanged"
    Rows="10" TabIndex="3" ></asp:ListBox>&nbsp;
    <br />
    
    <asp:Label ID="lblAddPager" runat="server" CssClass="lblAddPager" Text="Pager no:"></asp:Label>&nbsp;
    <asp:TextBox ID="txtAddPager" runat="server" CssClass="txtAddPager" TabIndex="4"></asp:TextBox>
    <asp:Button ID="btnAddPager" runat="server" CssClass="btnAddPager" OnClick="btnAddPager_Click"
        TabIndex="5" Text="Add" /><asp:Label ID="lblPagerNo" runat="server" CssClass="lblPagerNo" Font-Bold="False"
        Text="Recipients: "></asp:Label>&nbsp;
    <asp:ListBox ID="txtPagerNo" runat="server" CssClass="txtPagerNo" OnSelectedIndexChanged="txtPagerNo_SelectedIndexChanged" ></asp:ListBox>&nbsp;
    <asp:Label ID="lblRemovePager" runat="server" CssClass="lblRemovePager" Font-Bold="False"
        Text="Click to remove."></asp:Label><br />
    
    <asp:Label ID="lblSendMessageText" runat="server" CssClass="lblSendMessageText" Font-Bold="False"
        Text="Message: (maximum of 100 characters)"></asp:Label>&nbsp;
    <asp:TextBox ID="txtPagerMessage" runat="server" CssClass="txtSendMessage" onkeyup="fieldLengthCheck(this,this.value,100);" 
    TabIndex="7" MaxLength="100" OnTextChanged="txtPagerNo_SelectedIndexChanged" TextMode="MultiLine"></asp:TextBox>
    <asp:Label ID="txtSearchError" runat="server" CssClass="txtSearchError" ForeColor="Red"></asp:Label><br />
    <div id="spanCounter" class="lblCount"></div>
    <asp:Label ID="txtAddPageError" runat="server" CssClass="txtAddPageError" ForeColor="Red"></asp:Label><br />
    <asp:TextBox ID="txtPagerList" runat="server" CssClass="txtPagerList"></asp:TextBox>&nbsp;<br />
    <asp:Label ID="lblChangeContact" runat="server" CssClass="lblChangeContact" Text="Pager change requests should be sent to the XXXXXXXXXXXXXXXX Telephonists."></asp:Label>
    
    </ContentTemplate >
    </asp:UpdatePanel>
    
    <uc2:UserLogin id="UserLogin" runat="server">
    </uc2:UserLogin>
    <asp:Label ID="txtError" runat="server" CssClass="ERROR" ForeColor="Red"></asp:Label><asp:Label ID="txtSuccess" runat="server" CssClass="txtSuccess"></asp:Label><br />
    
    <asp:Button ID="btnSendMessage" runat="server" AccessKey="1" CssClass="btnSendMessage"
        OnClick="btnSendMessage_Click" TabIndex="8" Text="Send" />
    <asp:Button
        ID="btnRemove" runat="server" CssClass="btnRemove" OnClick="btnRemove_Click"
        Text="Remove" TabIndex="6" />
    Component UserLogin.aspx
    Code:
    <%@ Control Language="C#" AutoEventWireup="true"  EnableViewState="true" CodeFile="UserLogin.ascx.cs" Inherits="Components_UserLogin" %>
    &nbsp;<asp:Label ID="txtUserLogin" runat="server" CssClass="UserLogin"></asp:Label>
    Last edited by WeePecky; May 7th, 2008 at 07:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured