Solved

Enabling Smart Navigation and using JavaScript Code does not work

Posted on 2003-11-30
9
455 Views
Last Modified: 2008-02-26
I have enabled smart navigation for my ASP.Net web application.
It works fine except for some of my pages where I'm using some Javascript code.
Here is a sample Javascript code which I'm using

      Response.Write("<script language='javascript'>")
                Response.Write("window.open('POREP01.aspx')")
                Response.Write("</script")        
      Response.Write(">")

The error message which I'm getting is
'htmlfile:Invalid pointer'

A page http://localhost/aspnet_client/system_web/1_0_3705_352/SmartNav.js is opened in debug mode in Visual studio.Net, and it breaks at the line

            hdm.appendChild(k);
Is this a bug from Microsoft,
Pls help,
regards,
Priya
0
Comment
Question by:Priya25
  • 4
  • 4
9 Comments
 
LVL 12

Accepted Solution

by:
roverm earned 250 total points
Comment Utility
It seems that the adding of the javascript is causing the error.
Try to add it via the Register function and use a function:

In your page_load event:

Dim strScript As String = "<script language='javascript'>" & vbCrLf
strScript += " function window.onload() {" & vbCrLf
strScript += "    window.open('POREP01.aspx'); }" & vbCrLf
strScript += "</script>" & vbCrLf

Me.RegisterClientScriptBlock("yournameofthescript", strScript)

D'Mzz!
RoverM
0
 

Author Comment

by:Priya25
Comment Utility
Your solution works fine..thanx very much..

But now the new window is being displayed at the back of the main web page...that is it is minimised..we have to maximise it to see it...my user may not notice that the new window has been opened...
0
 
LVL 12

Expert Comment

by:roverm
Comment Utility
Hi priya, thanks for the points but why did you close it with a B while with a little more information it could have been an A?

The solution is to add some 'features' to the window.open:

  var sfeat='left=50,top=50,height=450,width=550,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes';
  window.open('POREP01.aspx', '_blank', sfeat);

D'Mzz!
RoverM
0
 

Author Comment

by:Priya25
Comment Utility
sorry for not giving u an A..also u deserve it..its just because the solution was not 100 % complete...i mean the
window was opening at the back...I'll try what u just send...

But rest assured this mistake will not be repeated.

Thanx again and Regards,
Priya
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 12

Expert Comment

by:roverm
Comment Utility
>>just because the solution was not 100 % complete

Not entirly true, I copied your open statement from the question. I could not know that you wanted to do something else with it.
So, the solution *was* complete, you just needed something more than you originally asked for.

But if you agree that this should have been an A-grade (not just for me, but also for the value of this PAQ) then I can ask a moderator to correct it. Just let me know.

I assume that adding the features helped?

D'Mzz!
RoverM
0
 

Author Comment

by:Priya25
Comment Utility
Hello RoverM,
I didn't know that it will so much difference to someone to get a B instead of an A..In fact I even dont know
how does EE handles the marking scheme..I must say that I'm quite new to EE.

Anyway as u mentioned, you can ask a moderator to correct it, its fine for me.
But ading the features did not work..I've already tried it..the window still opens at the back..

Regards and sorry,
Priya
0
 

Author Comment

by:Priya25
Comment Utility
I have been able to make the pop screen appear on top by adding the following in my HTML

<body onLoad="window.focus()">

this works fine...
You have been of great help to me,
Thanx
0
 
LVL 12

Expert Comment

by:roverm
Comment Utility
Priya25,
Thanks, and it's no problem! No need to apologize! ;-)

D'Mzz!
RoverM
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now