How call this javascript hidden field call behind code in asp.net

Posted by Cpatil1000 under ASP.NET on 4/21/2016 | Points: 10 | Views : 329 | Status : [Member] | Replies : 1
Hi,
I want javascript hidden field values in behind code, because
now a day we going software audited. I can use hidden field but
he can clear text values. so i can acces this value

function InitializeRequest(path) {
// call server side method
var pwdhfld = document.createElement("INPUT");
pwdhfld.type = "hidden";
pwdhfld.name = "t";

pwdhfld.value = path;
document.forms[0].appendChild(pwdhfld);

PageMethods.SetDownloadPath(path);
}




Responses

Posted by: Raja on: 4/21/2016 [Member] Starter | Points: 25

Up
0
Down
Assuming your forms method is set to "POST", you can access this in the server side as

string t = Request.Form["t"];

as the name of the element you have set as "t".

Thanks


Regards,
Raja, USA

Cpatil1000, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response