• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 107
  • Last Modified:

VB.NET Server side Javascript

I have a sub and on load I can get this to work...
ScriptManager.RegisterStartupScript(Me, [GetType](), "alertMessage", "alert('LBRISTER');", True)

However....
I Cannot get this code to work...
What am I missing?

Dim url As String = "return window.radopen('EmployeeContact.aspx?MyLeads=1&ispop=1&IndividualID=1&CampaignID=0&OriginID=0&IsPopup=1','ViewContact');"
ScriptManager.RegisterStartupScript(Me, [GetType](), "script", url, True)

Open in new window



That string above works when assigned as an attribute in a RadGrid...
DirectCast(dataItem.FindControl("LinkName"), HyperLink).Attributes("onclick") = "return window.radopen('EmployeeContact.aspx?MyLeads=1&ispop=1&IndividualID=" & IndividualID & "&CampaignID=" & CampaignID & "&OriginID=" & OriginID & "&IsPopup=1" & "','ViewContact');"

Open in new window

0
lrbrister
Asked:
lrbrister
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
Javascript has to be 'client-side' not server side.
0
 
lrbristerAuthor Commented:
Then why does the alert work?
0
 
KarenAnalyst programmerCommented:
Well my guess is that you are trying to open a new window just in javascript, instead of getting the user to trigger it by clicking on something. Browsers and security settings usually stop that sort of thing.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Ryan ChongCommented:
I Cannot get this code to work...
need to know in what event, when and how you called that code...
0
 
KarenAnalyst programmerCommented:
Dim url As String = "return window.radopen('EmployeeContact.aspx?MyLeads=1&ispop=1&IndividualID=1&CampaignID=0&OriginID=0&IsPopup=1','ViewContact');"
ScriptManager.RegisterStartupScript(Me, [GetType](), "script", url, True)

Open in new window


how does this code get added to the page? Is it triggered by a user clicking on a button?
0
 
lrbristerAuthor Commented:
Karen
It is created in the Page Load event
0
 
lrbristerAuthor Commented:
Sorry for the late get-back
Thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now