Need to pass a value from web page to codehind from a hyperlink with a parameter like e.g. page.aspx?id=1. I want to use jQuery if appropriate
How can I pass this value to the code behind without exposing as a querystring in the browser?
One way to do it is to use an ASP.NET hidden field.
<asp:HiddenField id="hdnWhatever" runat="server" value="blah" />
This field can then be manipulated with javascript or jquery and can also be easily used in your codebehind.
Try submitting form as jSON .. Sample -> replace [#form-request] with your form and [/index.php?option=com_seomozapi&task=request.save] with the file action/destination .. return false will keep the focus on current page (no server side refresh)
getScript('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function() {
js = jQuery.noConflict();
js(document).ready(function() {
js('#form-request').submit(function(event) {
console.log('test 1');
$.post('/index.php?option=com_seomozapi&task=request.save'); ?>', $('#form-request').serialize(), function (data, textStatus) {
//Do something here
});
console.log('test 3');
return false;
console.log('test 4');
});
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With