-2

I'm trying to store value in client side and access it in server side without using hidden field because of security issues.

I tried using label but I wasn't able to access the value on server side.

I could use web methods but I don't want to postback the page and I cannot use viewstate because its is encrypted and using session is not a good option.

Philippe Boissonneault
  • 3,949
  • 3
  • 26
  • 33
Sainath Naidu
  • 31
  • 1
  • 8
  • 1
    your question is pretty ambiguous. What exactly are your trying to achieve? If you're trying to send a variable to the server, why is the post method not an option (even an AJAX post)? – exceptional exception Jan 08 '15 at 16:23
  • Hidden Field comes handy when it comes to store values on client side. Even if we can't see content at page view but still one can easily see content from Dom element by inspecting it. If security is your main concern and if u are assigning value from code behind just set hidden field visibility false . It won't be displayed at Dom level and will be still accessible from server but not from client side. – Suprabhat Biswal Jan 08 '15 at 17:18
  • @user3479671 the problem is that i store value in hidden field on client side and on the submit button click i want to post back the page.Its basically a mobile recharge web application written in c# on asp.net and when i enter the first 4 numbers of mobile number then i store the value in hidden field.If i post back the page it will be a drawback for the user thats the only reason i did not want to postback the page – Sainath Naidu Jan 09 '15 at 08:54

1 Answers1

0

Try doing this, it can be posted to any server side languages such as asp, php or aspx pages.

http://www.w3schools.com/jquery/ajax_post.asp

Jquery Ajax - post huge string value

Thanks, Anand

Community
  • 1
  • 1