i have this section of code in my ASP.NET web application
string promptBox = "";
Page.RegisterStartupScript("IP selection",promptBox);
I can't figure a way to capture the value entered by the user in the prompt into my ASP.NET application. I basically want to store this value in a string and access it within my code-behind.
Thanx,
KV
Binu SubiPosted Feb 17, 2006, 4:16 PM
write a function in your client side (javascript),
function askforIP()
{
var myIP =
var myQstr = "myPage.aspx?q=" + myIP;
document.forms[0].action = myQstr;
document.forms[0].submit();
}
change your server side to accept this page load and process, also you can now register just the call to this function using registerstartupscript() call.
I personaly dont like this convoluted process to validate something or accept a user input. Consider thinking about a more intuitive design..
Cheers
nagabhushan hegdePosted Feb 17, 2006, 1:25 AM