locked
ASP .NET dyndns setup conflict ? - post method not fired RRS feed

  • Question

  • User2076294728 posted

    Hi,

       I have a bizar behavior. I developed a web page that uses ASP.NET forms.

       In debug mode (web developer express) OR accessing the page within the local domain (e.g. http://192.168.1.102/.......) the page executes correctly - meaning that once I click on an ASP button the POST method of the form gets executed.

       Now - if access the same web page via my domainname (e.g. http://www.ecofin.ca/......) the POST method does not get triggered && instead only the GET method is executed. Since I have a datagrid that grows in columns when a number is inserted that does not happen anylonger and only default columns are set.

       I am using dyndns to redirect the URL request to my own PC && since as long as I am within the same subnet as the webserver I am getting the correct behaviour then I am wondering if there is any specific setup for my webserver/dyndns that has to be done ?

        Any ideas what I do wrong ?!?

    Thanks,

    Dan S.

    Thursday, May 28, 2009 6:10 PM

Answers

  • User2076294728 posted

    Hi,

       Found why: url masking. Turning off the masking of the redirect (or frowarding) makes the page working ok. The POST is not changed anylonger in a GET.

       Hmmm .....

    Cheers,

    Dan S.

      

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 31, 2009 10:32 AM

All replies

  • User176332441 posted

    Should work fine.. hmm........ 

    can you paste your code

    Thursday, May 28, 2009 8:06 PM
  • User2076294728 posted

     Yes. One more thing : method="post" action="notax.aspx" - in the form definition does not make a diff. It looks like the page is refreshed since the Trace shows only GET && I am wondering if somehow a POST && right away a GET does not occur - somehow. Anyhow - bizar issue !

    <%@ Page Language="VB" Trace="true" CodeFile="~/AnaEco/notax/notax.aspx.vb" Inherits="CustomDataGrid" %>

    <!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 runat="server">
        <meta name="AUTHOR" content="Dan Sirbu" />
        <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
        <meta name="KEYWORDS" content="analyse économique projet inginierie sans impôt" />
        <link rel="stylesheet" type="text/css" href="../../StyleSheet.css" />
        <title>Analyse de Projet Sans Impôt</title>

        <script type="text/javascript" language="javascript" src="../../scripts/number-functions.js">
        </script>

        <script type="text/javascript" language="javascript" src="../../scripts/AnaEco/common.js">
        </script>

        <script type="text/javascript" language="javascript" src="../../scripts/AnaEco/notax.js">
        </script>

        <style type="text/css">
            .style1
            {
                width: 111px;
            }
            .style2
            {
                height: 26px;
                width: 569px;
            }
            .style3
            {
                height: 26px;
                width: 111px;
            }
        </style>
    </head>
    <body class="headerbody">
        <h1 class="header1">
            TABLEAU DES FLUX MONETAIRES
            <br />
            (sans impôt)
        </h1>
        <form id="form1" method="post" action="notax.aspx" runat="server">
        <p>
            <br />
        </p>
        <div style="display: block; vertical-align: middle; text-align: left" onmouseout="vbscript:MyFormOnExit">
            <table style="; width: 100%;" id="TABLE1">
                <tr>
                    <td class="style1">
                        <asp:Label ID="LabelNP" runat="server" Style="text-align:left; padding-right:10px"
                            Text="No. de Periodes:">
                        </asp:Label>
                    </td>
                    <td class="style2" valign="middle" align="center" style="width: 41px">
                        <asp:TextBox ID="TextBoxNP" runat="server" MaxLength="2" OnPreRender="RendNoPeriodes"
                            OnTextChanged="UpdateNoPeriodes" ToolTip="Entrer un Nombre Entier compris entre 1 et 10"
                            Width="25px" Text="1" Style="text-align: center;"></asp:TextBox>
                    </td>
                    <td align="center" style="width: 134px; height: 26px">
                        <asp:Button ID="Button1" runat="server" Text="Generer Tableau" OnClick="GenerateTable"
                            ToolTip="Genere le Tableau des Flux Monetaires" OnClientClick="openSameWindow()"
                            Width="131px" />
                    </td>
                    <td align="center" style="font-size: xx-small; width: 32px; color: black; font-family: Arial;
                        text-align: center">
                        <img alt="aide" onmouseover="showHelp()" src="../../App_Img/info.gif" style="cursor:pointer;" />
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        <asp:Label ID="LabelTRM" runat="server" Style="text-align:left; padding-right:10px"
                            Text="TRM:"></asp:Label>
                    </td>
                    <td class="style2" align="center" style="width:41px; height:26px">
                        <asp:TextBox ID="TextBoxTRM" runat="server" Width="25px" MaxLength="3" Text="10"
                            OnPreRender="RendTRM" OnTextChanged="UpdateTRM" Style="text-align: center;">
                        </asp:TextBox>
                    </td>
                    <td align="center" style="width: 134px; height: 26px">
                        <asp:Button ID="Button2" runat="server" Text="Reseter Tableau" OnClick="ResetTable"
                            ToolTip="Reset le Tableau des Flux Monetaires" Width="131px" OnClientClick="openSameWindow()" />
                    </td>
                    <td style="width: 13px; height: 26px">
                    </td>
                    <td style="width: 32px; height: 26px">
                    </td>
                    <td style="height: 26px">
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <br />
        <br />
        <br />

        <script type="text/javascript" language="javascript">
            document.oncontextmenu = noContextMenu;
            rowTotalRecette = <%=session("rowTotalRecette")%> + 1;
            rowCoutExpl = <%=Session("rowCoutExpl")%> + 1;
            rowTotalCoutExpl = <%=Session("rowTotalCoutExpl")%> + 1;
            rowFluxMonExpl = <%=Session("rowFluxMonExpl")%> + 1;
            rowInvCC = <%=Session("rowInvCC")%> + 1;
            rowTotalInvCC = <%=Session("rowTotalInvCC")%> + 1;
            rowFondRoule = <%=Session("rowFondRoule")%> + 1;
            rowTotalFondRoule = <%=Session("rowTotalFondRoule")%> + 1;
            rowRecupFondRoule = <%=Session("rowRecupFondRoule")%> + 1;
            rowFluxMonInv = <%=Session("rowFluxMonInv")%> + 1;
            rowFluxMonTot = <%=Session("rowFluxMonTot")%> + 1;
            rowFluxMonCum = <%=Session("rowFluxMonCum")%> + 1;
        </script>

        <div>
            <asp:DataGrid ID="dgProducts" runat="server" AutoGenerateColumns="False" CellPadding="0"
                HeaderStyle-BackColor="DarkGray" HeaderStyle-ForeColor="WindowText" HeaderStyle-HorizontalAlign="Center"
                HeaderStyle-Font-Bold="False" HeaderStyle-Font-Italic="False" HeaderStyle-Font-Overline="False"
                HeaderStyle-Font-Strikeout="False" HeaderStyle-Font-Underline="False" HeaderStyle-Font-Names="Arial"
                HeaderStyle-Font-Size="Small" ItemStyle-ForeColor="Navy" ItemStyle-BackColor="White"
                OnInit="DataGrid_Init" OnItemDataBound="DataGrid_ItemDataBound" BorderColor="#CCFFFF"
                BorderStyle="Double">
                <Columns>
                    <asp:BoundColumn ReadOnly="True">
                        <ItemStyle Width="20" BackColor="DarkGray" />
                        <HeaderStyle Width="20" />
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="" ItemStyle-Width="180">
                        <ItemTemplate>
                            <asp:TextBox ID="Static" runat="server" ForeColor="Navy" Width="215" OnPreRender="DataGrid_TextBox_OnInit"
                                Text='<%# DataBinder.Eval(Container, "DataItem.Item1") %>' Font-Names="Arial"
                                Font-Size="Small" BorderStyle="None" BorderWidth="0">                          
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="0" ItemStyle-Width="70">
                        <ItemTemplate>
                            <asp:TextBox ID="timeZero" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item2") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="1" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeOne" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item3") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="2" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeTwo" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item4") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="3" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeThree" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item5") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="4" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeFour" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item6") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="5" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeFive" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item7") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="6" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeSix" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item8") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="7" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeSeven" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item9") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="8" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeEight" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item10") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="9" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeNine" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item11") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="10" ItemStyle-Width="70" Visible="False">
                        <ItemTemplate>
                            <asp:TextBox ID="timeTen" runat="server" ForeColor="Navy" Width="70" OnPreRender="DataGrid_TextBox_OnInit"
                                OnTextChanged="DataGrid_TextBox_TextChanged" Text='<%# DataBinder.Eval(Container, "DataItem.Item12") %>'
                                BorderStyle="None" BorderWidth="0">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:DataGrid>
        </div>
        <div id="popmenu1" style="; left: 0px; display: none;">
            <asp:Menu ID="NavigationMenu" runat="server" BorderColor="Snow" BorderStyle="Outset"
                DynamicEnableDefaultPopOutImage="False" MaximumDynamicDisplayLevels="2" OnMenuItemClick="NavigationMenu_MenuItemClick"
                BackColor="#9999FF" BorderWidth="2px" Font-Names="verdana" Font-Size="Small"
                ForeColor="Maroon" StaticBottomSeparatorImageUrl="../../App_Img/DividerBar.gif"
                StaticMenuItemStyle-CssClass="menuitem" CssClass="menuitem">
                <StaticHoverStyle BackColor="#FFFF99" />
                <Items>
                    <asp:MenuItem Text="Add Row" ToolTip="Adds a New Row into the DataGrid" Value="Add">
                    </asp:MenuItem>
                    <asp:MenuItem Text="Delete Row" ToolTip="Deletes the selected Row from the DataGrid"
                        Value="Delete"></asp:MenuItem>
                </Items>
            </asp:Menu>
            <asp:TextBox runat="server" AutoPostBack="true" ID="MyTextBox" OnTextChanged="MyTextBox_TextChanged"
                Style="display: none">
            </asp:TextBox>
        </div>
        <p>
            <asp:Button ID="Button3" runat="server" Text="Graphique Flux Monétaire" OnClick="GenGraphFluxMon"
                Width="192px" OnClientClick="openNewWindow()" />
            <asp:Button ID="Button4" runat="server" Text="Graphique VANs" OnClick="GraphVanFluxMon"
                Width="192px" OnClientClick="openNewWindow()" />
            <asp:Button ID="Button5" runat="server" Text="Analyse Projet" OnClick="AnalProjet"
                Width="161px" OnClientClick="openNewWindow()" />
        </p>
        <div id="Help" style="display:none; ; left:350px; top:100px;
            border-right:gray thin solid; border-top:gray thin solid; border-left:gray thin solid;
            border-bottom:gray thin solid; background-color:#FFFFCC;">
            <table id="TABLE2">
                <tr>
                    <td align="right" style="font-size: 8pt; vertical-align: top; font-family: Arial;
                        text-align: right">
                        <img alt="" src="../../App_Img/close.gif" onclick="javascript:hideHelp();" height="10"
                            style="cursor:pointer;" />
                    </td>
                </tr>
                <tr>
                    <td style="font:icon; font-style:normal; font-size:x-small; text-align:justify;
                        list-style-; vertical-align:middle; direction:ltr; line-height:normal;
                        list-style-type:circle; text-align: justify;" width="300">
                        Pour démarrer le logiciel, prière de rentrer:&nbsp;<br />
                        <ul>
                            <li>Nombre de périodes - qui doit être un nombre entier entre 1 et 10. Il est mandatoire;<br />
                            </li>
                            <li>Taux d'actualisation - qui doit être un nombre entier entre 0 et 100 et qui représente
                                un %. Il a une valeur default de 10% et donc n'est pas mendatoire;</li>
                        </ul>
                        <p>
                            Une fois ces informations fournies, prière de suivre les étapes identifiées par
                            les boutons qui activeront le logiciel.
                        </p>
                        <p>
                            Dans la table des Flux Monétaires, prière de bien identifier les flux monétaires
                            négatifs '-' (↓) et positifs '+' (↑). Sinon, les résultats seront faux.
                        </p>
                        <p>
                            Pour entrer une nouvelle donnée dans le tableau des flux, prière d'insérer une nouvelle
                            ligne ensuite entrer les informations desirées. Pour inserer une nouvelle ligne
                            vous devez choisir l'option "Ajouter Nouvelle Ligne" qui apparait en clickant sur
                            le boutton droit de la souris.</p>
                        <p>
                            Exemple:</p>
                        <ul>
                            <li>Les recettes sont des flux positifs et donc doivent être entrées avec le signe '+'
                                (↑);&nbsp;</li>
                            <li>En revanche, les coûts sont des flux négatifs et donc doivent être entrés avec le
                                signe '-' (↓). </li>
                        </ul>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    </html>
     

    Thursday, May 28, 2009 8:14 PM
  • User2076294728 posted

    Some more troubleshooting. I used Wiresharsk to look at the sequence - so here are my findings:

    (a) access via domainname:

    192.168.1.102 70.35.16.197 HTTP GET /AnaEco/notax/notax.aspx HTTP/1.1

    38.113.184.7 192.168.1.102 HTTP GET //AnaEco/notax/notax.aspx HTTP/1.1       <-- the GET has 2 "/" from one due to redirect

    When I click on the submit button:

    192.168.1.102 70.35.16.197 HTTP POST /AnaEco/notax/notax.aspx HTTP/1.1 (application/x-www-form-urlencoded) <-- the POST is here

    BUT right away after that:

    38.113.184.7 192.168.1.102 HTTP GET //AnaEco/notax/notax.aspx HTTP/1.1 <-- there is a GET && notice again the 2 "//"

    So: somehow the POST is redirected via a GET ?!? Hmmm ... Or there is an ASP error due to the redirect which triggers the GET instead ?!? Since the page looks as refreshed ....

    (b) from localdomain:

    192.168.1.106 192.168.1.102 HTTP GET /AnaEco/notax/notax.aspx HTTP/1.1 <-- there is no "//" since no redirect

    And then when I click on the submit button:

    192.168.1.106 192.168.1.102 HTTP POST /AnaEco/notax/notax.aspx HTTP/1.1 (application/x-www-form-urlencoded)

    192.168.1.102 192.168.1.106 HTTP HTTP/1.1 200 OK (text/html) <-- no GET just the OK confirmation

     So - there must be an issue at the redirection level or something in my setup - unfortunately which one ?!?

     

    Any ideas ?!?

    Cheers,

    Dan S.

    Friday, May 29, 2009 8:10 PM
  • User2076294728 posted

    Hi,

       Found why: url masking. Turning off the masking of the redirect (or frowarding) makes the page working ok. The POST is not changed anylonger in a GET.

       Hmmm .....

    Cheers,

    Dan S.

      

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 31, 2009 10:32 AM