Solved

Run ASP.NET application by hising the address bar

Posted on 2011-03-04
15
744 Views
Last Modified: 2013-11-12
Hi Experts,
I am using Silverlight 4.0 using VB.NET. I am trying to hide the address bar , so that it resembles like desktop application. How to hide the address bar.

Kind regards,
Pooja
0
Comment
Question by:poojasureshkumar
  • 7
  • 5
15 Comments
 
LVL 12

Expert Comment

by:Cyber-spy
ID: 35040615
Here's a way of doing it through Javascript: http://saher42.wordpress.com/2006/08/10/hiding-the-address-bar-on-pageload-using-javascript/

However, what this does is to open a new Window, with no scrollbars, address bar, toolbars etc, and close the original.

I'd recommend you don't close the original Window though - any web app I used that went and closed my browser wouldn't be use again!

0
 

Author Comment

by:poojasureshkumar
ID: 35058047
Hi Cyber-spy,
I am using Silverlight . I did what you have advised in aspx page. I am still seeing the address bar.

Kind regards,
Pooja
0
 
LVL 12

Expert Comment

by:Cyber-spy
ID: 35058916
So, you opened a new Window (using JavaScript) in which you run your SilverLight app?

window.open(params)

The params determine what the window displays - scroll bar, address bar etc


What's the code you used to open the new Window?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:poojasureshkumar
ID: 35059011
Hi Cyber-spy,
I am using the button in ASPX page which uses silverlight plugin. Wehni click the button it opens the respective xaml pages. I hope i am clear in my question and sorry for confusing you earlier if i did it.
My task now is initially when the aspx loads it should hide addressbar.

function openWindow(){
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer")
{
    window.opener = self;
   

}
//window.open("MyVBSilverlightAppTestPage.aspx", "Details", "addressbar=no,statusbar=no");

window.open("TestPage.aspx", 'null', 'width=900,height=750,toolbar=0,scrollbars=0,location=0,resizable =1');
//window.open("TestPage.aspx", 'null', 'width=900,height=750,toolbar=no,scrollbars=no,location=no,resizable =yes');
//window.moveTo(0, 0);
//window.resizeTo(screen.width,screen.height-100);
//self.close();
}


<body>

    <form id="form1" runat="server" style="height:100%">
    <div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
              <param name="source" value="ClientBin/TestApp.xap"/>
              <param name="onError" value="onSilverlightError" />
              <param name="background" value="white" />
              <param name="minRuntimeVersion" value="4.0.50826.0" />
              <param name="autoUpgrade" value="true" />
           <param name="initParams"  value="num=1"/>
              <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
                     <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
              </a>
          </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
       
    </form>
</body>


Kind regards,
Pooja
0
 

Author Comment

by:poojasureshkumar
ID: 35070980
Hi Cyber-spy,
In App.xaml.vb showing the parent xamlpage.
 Me.RootVisual = New dectrol1(User)

Here i need to avoid the addressbar.

Kind regards,
Pooja
0
 
LVL 12

Expert Comment

by:Cyber-spy
ID: 35074357
As the Silverlight app will run in the new Window, can you not open the window from the parent browser window using JavaScript?

Have a look at http://www.javascripter.net/faq/openinga.htm for the Window.open() function.

An example might be:
    <a href="#" onclick="window.open('your_silverlight_page.aspx','mywin','left=20,top=20,width=500,height=500,toolbar=no,location=no,resizable=no');">Open Window</a>

Open in new window


However, after some reading (and testing!) it does not seem possible to hide the URL bar (location=no) in FF and Chrome (although it seemed to work in IE8).

The reason for this is security. Think of all the fun hackers could have if they could take you to their site, while you actually thought you were on your Bank's website!
0
 

Author Comment

by:poojasureshkumar
ID: 35099915
Hi Cyber-spy,
When i use window.open, application hangs...

Kind regards,
Pooja
0
 

Author Comment

by:poojasureshkumar
ID: 35099945

Hi Cyber-spy,
In ASPX,
function openWindow(){
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer")
{
    window.opener = self;
   

}
//window.open('TestPage.aspx', 'Details', 'addressbar=0,statusbar=0');

//window.open("TestPage.aspx", 'null', 'width=900,height=750,toolbar=0,scrollbars=0,location=0,resizable =1');
//window.open("TestPage.aspx", 'null', 'width=900,height=750,toolbar=no,scrollbars=no,location=no,resizable =yes');
//window.moveTo(0, 0);
//window.resizeTo(screen.width,screen.height-100);
//self.close();
}
    </script>


XAML code
------------
Dim script As ScriptObject
 script = CType(HtmlPage.Window.GetProperty("openWindow"), ScriptObject)
script.InvokeSelf()

Kind regards,
Pooja
0
 
LVL 12

Expert Comment

by:Cyber-spy
ID: 35113564
Hi,

I'm a little confused here.

I thought you had a Silverlight Appp which you wanted to run in a new Window.
So, in the parent window, you need a link which opens a new Window, with as much decoration turned off as possible, and the page that hosts your Silverlight app.

However, you seem to be trying to use Silverlight to open the Window too.

Do you have a Silverlight app running in the parent Window as well, the window you want to close?

Regards

Adam
0
 

Author Comment

by:poojasureshkumar
ID: 35159081
Hi Adam,
Yes , the parent window also got silverlight.

Kind regards,
Pooja
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 35887115
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
LVL 12

Accepted Solution

by:
Cyber-spy earned 125 total points
ID: 35887116
I provided some good examples on how to achieve what was required, as close as possible to what can actually be achieved in aborwser.
I also pointed out that, for security reasons, a full solution was not really possible.

I believe I should get points for my answers.
0
 

Author Comment

by:poojasureshkumar
ID: 35894242
Hi Cyber-spy,
Thanks for the support that you are provided. It is not possible to hide the address bar in silverlight app and there are lot of ways a user can pick if she decided to see the addressbar in any case. So i am not ready to spend on time on this issue.

Kind regards,
Pooja
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

816 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

9 Experts available now in Live!

Get 1:1 Help Now