?
Solved

Enabling Smart Navigation and using JavaScript Code does not work

Posted on 2003-11-30
9
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 12

Accepted Solution

by:
roverm earned 1000 total points
ID: 9849632
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
ID: 9865783
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
ID: 9865911
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
Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

 

Author Comment

by:Priya25
ID: 9865981
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
 
LVL 12

Expert Comment

by:roverm
ID: 9866067
>>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
ID: 9872186
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
ID: 9872400
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
ID: 9872860
Priya25,
Thanks, and it's no problem! No need to apologize! ;-)

D'Mzz!
RoverM
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 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