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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Javascript function from VB.Net

Status
Not open for further replies.

mguwc

Technical User
Mar 16, 2004
74
US
Hi - I've have an issue with PostBack of a page.

I have created a web application where the default page is in two sections (frames) - the top [banner] and the bottom [content].

There is a menu in my content section that navigates from page to page without links. By this I mean that when you are using the menu, you can go to "fresh" new pages within the content.

When you navigate from page to page from within the contents of the page (example: from the demographics page you can navigate to the activity page with the client id being the link) - OnLoad of each page, the Top [Banner] is reloaded. The Top [Banner] will then give you
client specific information....

If you navigate to a page FROM the menu, then the Top [Banner] gives you a generic Title and Picture.

My Javascript function that is called onload of each page is :

function init()
{
parent.frames['banner'].location.reload();
}

I have tried the following to avoid the Top reloading with every postback:

function init()
{
if (!IsPostBack)
{
}
parent.frames['banner'].location.reload();
}

However, when it goes through the process, it crashes with the following error:

Microsoft JScript runtime error: 'IsPostBack' is undefined

I don't understand why this occurs. Can someone please help me? Is there a way to call the javascript from VB script. Example:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not Page.IsPostBack Then

Parent.Frame[Banner].Attributes("onload")= "javascript:init();"

I have tried this, however this does not work...Any ideas?

- Maria

 
You may want to try asking in the ASP.NET forum (forum855)


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top