Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Following code is fine and the Jquery popup is shown.
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "ShowPopup", "ShowPopup();", True)

But in In the below code the popup is not shown when an extra line of code of Server.Transfer is added.
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "ShowPopup", "ShowPopup();", True)
Server.Transfer("frmWelcome.aspx", True)


Please help.

Thanks in Advance.
Posted
Comments
Karthik_Mahalingam 29-Apr-15 6:06am    
you need to add the code in the frmwelcome.aspx.cs
Ajith The Great 29-Apr-15 6:31am    
I will not get those contents on frmwelcome.aspx.cs page.
F-ES Sitecore 29-Apr-15 9:01am    
All you're doing is calling ShowPopup() so there is no data to retruieve. Unless "ShowPopup" needs something on the page? What you have to realise is that you can't use server.transfer to "merge" two html outputs together. You can't inject content into frmwelcome from your other page. If there is data you want to pass that page then store it in the Session and read it from the Session in frmwelcome.
[no name] 29-Apr-15 6:28am    
Why you want a server.transfer after calling a javascript function to open a popup.If you really want a round trip then why don't you do it with a button click from popup itself
Ajith The Great 29-Apr-15 6:45am    
I have some Encrypted content in Query String.

1 solution

As mentioned in the comments, you can't do it like this. Calling RegisterStartupScript is code on your server that will generate a call to javascript when the page is loaded on the client. However, that page never gets loaded because you transfer to frmWelcome.aspx first.

You can add something to the querystring that frmWelcome.aspx checks for and then show the popup on frmWelcom.aspx.

If you want to show the popup and then redirect, do it in javascript by setting window.location to the new url.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900