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

nagabhushan hegde26 reputationPosted Feb 16, 2006, 8:25 PM EST
Binu Subi68 reputationPosted Feb 17, 2006, 11:16 AM EST
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