Server values not persisted across postbacks

I post several values to server via jquery ajax method.
The values are posted to server (Request.Form values are present, also Post method parameters ok in Firebug), I store the values in either asp:hiddenfield or viewstate, but after a full pagepostback the hiddenfield data and viewstate data are reset to initial values.
I need these 2 values in a server method for further processing
Thanks
aspx:
$("#divUpsellData").dialog(
                 {
                     bgiframe: true,
                     autoOpen: false,
                     draggable: true,
                     modal: true,
                     position: 'bottom',
                     title: 'Input date upsell: ',
                     buttons: [
                        {
                            text: "Ok",
                            click: function() {
                                $.ajax({
                                    type: "POST",
                                    url: "OfertareEx.aspx",
                                    data: { nrsim: $("#<%= TextBoxUpsellSim.ClientID %>").val(),
                                        trafic: $("#<%= DropDownListUpsellTrafic.ClientID %>").val()
                                    },
                                    dataType: "html",
                                    async: false
                                });
                                $(this).dialog("close");
                            }
                        },
                        {
                            text: "Cancel",
                            click: function() {
                                $(this).dialog("close");
                            }
                        }
                            ]
                 });

<div id="divUpsellData" style="display:none">
        <asp:Label ID="Label29" Text="Numar:" runat="server"></asp:Label>
        <asp:TextBox ID="TextBoxUpsellSim" Width="70" runat="server" CssClass="customControls" Text="0">
        </asp:TextBox>
        <asp:Image ID="img1" runat="server" ImageUrl="~/Images/info.gif" CssClass="helpTip"
             ToolTip="Numar de sim-uri suplimentare aduse prin upsell" />
        <%--<input type="text" value="0" id="tbUpsellSim" />--%>
        <br />
        <asp:Label ID="Label30" Text="Trafic:" runat="server"></asp:Label>
        <asp:DropDownList ID="DropDownListUpsellTrafic" runat="server" 
            AutoPostBack="false" Width="100" CssClass="customControls">
            <asp:ListItem Selected="True" Text="fara trafic" Value="fara trafic"></asp:ListItem>
            <asp:ListItem Selected="False" Text="medie sim" Value="medie sim"></asp:ListItem>
        </asp:DropDownList>
        <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/info.gif" CssClass="helpTip"
             ToolTip="<ul><li>fara trafic: daca nu se estimeaza trafic suplimentar</li><li>medie sim: trafic suplimentar estimat cf mediei pe sim existenta</li></ul>" />
    </div>

aspx.cs:

protected void Page_Load(object sender, EventArgs e)
if (Request.Form["nrsim"] != null)
        {
            //hidUpsellSim.Value = Request.Form["nrsim"].ToString();
            //hidUpsellTrafic.Value = Request.Form["trafic"].ToString();
            ViewState["UpsellSim"] = Request.Form["nrsim"].ToString();
            ViewState["UpsellTrafic"] = Request.Form["trafic"].ToString(); 
            //TextBoxUpsellSim.Text = Request.Form["nrsim"].ToString();
            //DropDownListUpsellTrafic.SelectedValue = Request.Form["trafic"].ToString();
        }

Open in new window

danielivanov2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gurvinder Pal SinghCommented:
i guess this is because you didn't set these values in any hidden field.
It is the same value which was present when this screen was rendered.
0
danielivanov2Author Commented:
during ajax call, I store the values in either hidden field or viewstate (in debug mode the values are ok), no matter hiddenfield or viewstate values had been initialized, but after a page postback the values are lost..
0
Gurvinder Pal SinghCommented:
Sorry, i could not understand your response above.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

danielivanov2Author Commented:
I meant that, even I would store the values in hiddenfields (in code attached the lines are not enabled anymore, it was the first try), the values are not kept across page postback
0
Gurvinder Pal SinghCommented:
which values?
0
danielivanov2Author Commented:
the values sent via ajax post, see image attached ajax
0
Gurvinder Pal SinghCommented:
Is it possible for you to share the live internet link?
0
danielivanov2Author Commented:
no, it isnt possible, its an intranet application
i can share any other relevant code, if needed
0
Gurvinder Pal SinghCommented:
Not sure if it would be helpful, since i am trying to see the code without any ASP in it.
Is it possible for you to share the rendered HTML, and also point me to the troubling section of it?
0
danielivanov2Author Commented:
I have found my own solution, using Session instead ViewState - still don't know why ViewState didn't work (in the same page other ViewState objects work ok), but its good I could find an workaround
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
danielivanov2Author Commented:
I have found my own solution, as described above
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.