[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 818
  • Last Modified:

Run ASP.NET application by hising the address bar

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
poojasureshkumar
Asked:
poojasureshkumar
  • 7
  • 5
1 Solution
 
AdamSenior DeveloperCommented:
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
 
poojasureshkumarAuthor Commented:
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
 
AdamSenior DeveloperCommented:
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
poojasureshkumarAuthor Commented:
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
 
poojasureshkumarAuthor Commented:
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
 
AdamSenior DeveloperCommented:
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
 
poojasureshkumarAuthor Commented:
Hi Cyber-spy,
When i use window.open, application hangs...

Kind regards,
Pooja
0
 
poojasureshkumarAuthor Commented:

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
 
AdamSenior DeveloperCommented:
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
 
poojasureshkumarAuthor Commented:
Hi Adam,
Yes , the parent window also got silverlight.

Kind regards,
Pooja
0
 
Amandeep Singh BhullarCommented:
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
 
AdamSenior DeveloperCommented:
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
 
poojasureshkumarAuthor Commented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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