Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created a text box and a button in my main view page. I have created a partial view page also named "_PartialView". My requirement is when a user put something in the text box and click on the button, the partial page will display with the value which the user has entered in the text box. How to implement that with Session Storage?
Posted

1 solution

Why would you need session storage for this, and any server-side operation at all? This is the action which happens on the same page which does not need a postback. There is nothing to store in session data. You can just use JavaScript to read the control value and write this value elsewhere, such as in:
JavaScript
var myTextBox = document.getElementById("textBox");
var someParagraph = document.getElementById("someParagraph");

//...

someParagraph.innerHTML = myTextBox.value;
// only why? :-)

Something like that…

—SA
 
Share this answer
 
v2
Comments
Member 11710169 9-Jun-15 1:09am    
Thanks
Sergey Alexandrovich Kryukov 9-Jun-15 1:17am    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900