Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Modal Window



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> ASP & ASP.NET Forum
View previous topic :: View next topic  
Author Message
Andy0000



Joined: 15 Jan 2008
Posts: 4

PostPosted: Tue Jan 15, 2008 9:42 am    Post subject: Modal Window Reply with quote

Hi Guys,
I am new to Field of .Net and JavaScript.
I have a problem regarding Modal Window.
I have created a page in which when there is textbox and a button. Now when the user clicks on the button, a modal window should open in which there is calender control(for this I have created a another aspx page and added calender control on it.) I am calling this function on the button click

INSIDE PARENT WINDOW
-------------------------------------
function openCalender(id)
{
//I am sending the selected date to the calender control, to display the date that is in textbox
var selDate=document.getElementById(id).value;
var retVal=""
var valReturned;
//alert(selDate);
retVal=window.showModalDialog("DatePicker.aspx?formname=document.getElementById(\""+id+"\")&selectedDate="+selDate,retVal,"dialogWidth:230px;dialogHeight:190px");
valReturned=retVal;
document.getElementById(id).value=valReturned;
}

INSIDE MODAL WINDOW(CALENDER.ASPX)
--------------------------------------------------------------

protected void Calendar1_SelectionChanged(Object sender, System.EventArgs e)
{
string strjscript = "<script language='javascript'>";
strjscript += "window.returnValue= ' " + Calendar1.SelectedDate.ToString(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)+"';window.close();";
strjscript += "</script" + ">";
Literal1.Text = strjscript; //For putting the script

-------------------------------------------------------

Now as far as I think, I am returning the selected date through return.Value. But its now working. I tried to use alert and see what value it is returning. it was "undefined"

We cannot use window.opener because window.showModalDialog doesnot support it................
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> ASP & ASP.NET Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap