0

I have

<div id="ulAndil" runat="server">

</div>

and button

<asp:Button ID="btnAssignJudToCourse" runat="server" Text="تاكيد " 
      CssClass="button" CausesValidation="false" 
      OnClientClick="javascript:getShape();" 
      OnClick="btnAssignJudToCourse_Click" Visible="false" />

At runtime I create a lot of sortable html controls and then click confirm I want to save inner html of this div before postback of button in session or anything

Using jQuery so when user click the button jQuery take inner html of div and stores it in cookie session any thing to store it after postback I can retrieve it

Please I want the exact code for this jQuery or javascript method and how to call on button

1
  • Are you using HTML5? You could store it in session or localstorage then. Commented Apr 10, 2012 at 12:19

1 Answer 1

1

Why don't you put the generated HTML in a hidden field and postback.

Say getShape() is your javascript function

function getShape()
{

//your validations applied

document.getElementById('hdnHTML').value = document.getElementById('ulAndil').value;

return true;

}

where hdnHTML is the hidden element of HTML.

Sign up to request clarification or add additional context in comments.

3 Comments

ok after post back i can to retriev the inner html from hidden file?
i wrote code every time enter to function topld me that ulAndil div is null but i saw code generated in html in ulAndil div
are you getting value using ulAndil.innerHtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.