Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running javascript function from a link in an asp.net calender

Status
Not open for further replies.

Dherrera

Programmer
Mar 22, 2004
86
US
Can someone please shed some light on this for me, I have tried using
RegisterStartupScript and I cant get it to work.

The purpose of this is that the calendar is displaying info from a db and
when a link on the calendar is clicked it will open a popup window displaying
that info.

Thanks in advance.

Danny
 
I'm not sure I understand the question.

Basically, you're looking to open a new window using JavaScript that will display data from your DB in a new window?


If so: Create your calendar in a form where you specify target='_blank'; and your action="yourinfodisplaypage.asp"

If you need to run some kind of validation first, or set some properties you can set onClick='return PerformValidation();'

<script language = "JavaScript">
function PerformValidation()
{
if (document.yourformname.yourinputtag.value != "")
{
return true;
}
else
{
return false;
}
}
</script>


That's just pulled out of my butt so it will have errors. That should get you started in the right direction if this is in fact what you're looking for.
 
Thanks for replying.

Yes, the link will popup a new window with data from the DB.

I have the popup working fine with links that not in the calendar but i cant get it to work with the links that are IN the cells of the calendar.

i can get it launch the popup from:
link.NavigateURL = "popupwindow.aspx"

but that just opens a blank window, i need to pass a record ID to that link so that it gets the right info from the DB and that is where im running into trouble.

THanks
 
generally you would pass parameters in the URL

popupwindow.aspx?recordid=012584

And make popupwindow.aspx grab those url variables to query the db.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top