Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 20, 2012 03:22 PM by srinanthuram
Member
51 Points
91 Posts
Feb 17, 2012 02:21 PM|LINK
Hello there! I need to show a pop up to get the user input and pass it to the server side. But the pop up is not showing up. The webpage Default2.aspx is showing up as a blank page. Please help. Thanks in advance. Code below:
aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
function storeUserInput(value) {
document.getElementById("hidden").value = value;
}
</script>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<input runat="server" type="hidden" id="hidden" name="hidden">
</form>
</body>
</html>
aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
string prompt = "<script langauge='javascript'>" +
"var value = prompt('Please Enter ARL','')" +
"storeUserInput(value)" +
"</script>";
Response.Write(prompt);
//Page.RegisterStartupScript("Prompt", prompt);
protected void Submit()
string s = hidden.value;
Regards,
Elizabeth Bradley
All-Star
95503 Points
14106 Posts
Feb 17, 2012 02:59 PM|LINK
In your shown code you are never used window.Open or any modalpopup to show popup...so it will not showing up...
and in case the code which you showed up is actually a popup windows, then you dont have input elements in there...so it is blank...
Thanks,
Feb 20, 2012 01:52 PM|LINK
If I comment out "storeUserInput(value)", the popup window appears:
//"storeUserInput(value)" +
34545 Points
5554 Posts
Feb 20, 2012 02:31 PM|LINK
evb5145 If I comment out "storeUserInput(value)", the popup window appears:
do u mean, u get a new window? where is code to open this window?
or u mean u r getting prompt which allows u to enter url.... in that case, there might be some javascript syntax issue in storeUserInput function.
try setting semi colon at endlike "storeUserInput(value);"
hope this helps...
Contributor
6800 Points
1549 Posts
Feb 20, 2012 03:22 PM|LINK
hi
try this
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.js" type="text/javascript"></script> <script type="text/javascript" src="Scripts/jquery-ui-1.8.8.custom.min.js"></script> <link rel="stylesheet" type="text/css" href="Style/smoothness/jquery-ui-1.8.8.custom.css" /> <script type="text/javascript"> function ShowPopup() { $('#modelcontent').show(); $('#ModalDialog').dialog({ width: 400, modal: true, title: 'Eligibility Check' }); $("#ModalDialog").parent().appendTo($("form:first")); }
modelcontent and ModalDialog is Div Id
thank u
evb5145
Member
51 Points
91 Posts
pop up window
Feb 17, 2012 02:21 PM|LINK
Hello there! I need to show a pop up to get the user input and pass it to the server side. But the pop up is not showing up. The webpage Default2.aspx is showing up as a blank page. Please help. Thanks in advance. Code below:
aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
function storeUserInput(value) {
document.getElementById("hidden").value = value;
}
</script>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<input runat="server" type="hidden" id="hidden" name="hidden">
</form>
</body>
</html>
aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
string prompt = "<script langauge='javascript'>" +
"var value = prompt('Please Enter ARL','')" +
"storeUserInput(value)" +
"</script>";
Response.Write(prompt);
//Page.RegisterStartupScript("Prompt", prompt);
}
protected void Submit()
{
string s = hidden.value;
}
Regards,
Elizabeth Bradley
ramiramilu
All-Star
95503 Points
14106 Posts
Re: pop up window
Feb 17, 2012 02:59 PM|LINK
In your shown code you are never used window.Open or any modalpopup to show popup...so it will not showing up...
and in case the code which you showed up is actually a popup windows, then you dont have input elements in there...so it is blank...
Thanks,
JumpStart
evb5145
Member
51 Points
91 Posts
Re: pop up window
Feb 20, 2012 01:52 PM|LINK
If I comment out "storeUserInput(value)", the popup window appears:
string prompt = "<script langauge='javascript'>" +
"var value = prompt('Please Enter ARL','')" +
//"storeUserInput(value)" +
"</script>";
Response.Write(prompt);
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: pop up window
Feb 20, 2012 02:31 PM|LINK
do u mean, u get a new window? where is code to open this window?
or u mean u r getting prompt which allows u to enter url.... in that case, there might be some javascript syntax issue in storeUserInput function.
try setting semi colon at endlike "storeUserInput(value);"
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
srinanthuram
Contributor
6800 Points
1549 Posts
Re: pop up window
Feb 20, 2012 03:22 PM|LINK
hi
try this
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.js" type="text/javascript"></script> <script type="text/javascript" src="Scripts/jquery-ui-1.8.8.custom.min.js"></script> <link rel="stylesheet" type="text/css" href="Style/smoothness/jquery-ui-1.8.8.custom.css" /> <script type="text/javascript"> function ShowPopup() { $('#modelcontent').show(); $('#ModalDialog').dialog({ width: 400, modal: true, title: 'Eligibility Check' }); $("#ModalDialog").parent().appendTo($("form:first")); }</script>
modelcontent and ModalDialog is Div Id
thank u