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
                     bgiframe: true,
                     autoOpen: false,
                     draggable: true,
                     modal: true,
                     position: 'bottom',
                     title: 'Input date upsell: ',
                     buttons: [
                            text: "Ok",
                            click: function() {
                                    type: "POST",
                                    url: "OfertareEx.aspx",
                                    data: { nrsim: $("#<%= TextBoxUpsellSim.ClientID %>").val(),
                                        trafic: $("#<%= DropDownListUpsellTrafic.ClientID %>").val()
                                    dataType: "html",
                                    async: false
                            text: "Cancel",
                            click: function() {

<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: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: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>" />


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

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.
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..
Gurvinder Pal SinghCommented:
Sorry, i could not understand your response above.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook 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
Gurvinder Pal SinghCommented:
which values?
danielivanov2Author Commented:
the values sent via ajax post, see image attached ajax
Gurvinder Pal SinghCommented:
Is it possible for you to share the live internet link?
danielivanov2Author Commented:
no, it isnt possible, its an intranet application
i can share any other relevant code, if needed
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?
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

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
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

From novice to tech pro — start learning today.