Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

How to get aspx page to work in Active Desktop

I created a web application in ASP.NET that reads from a text file and displays it in a text box, you are able to edit the content in the textbox and then save any changes back to the same file.  This part works.
Now what I am attemping to do is set this webpage as the active desktop.  This way I can just type into the desktop and save it.  I won't have to open any windows since I can just type into the desktop.
The problem that I am having is that I click the button to read the text file and display it, and a browser window opens.  I don't want to have a browser open since it is already on my active desktop.  Any way to fix this?  

Here is my code.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim read As String
        Dim sr As New StreamReader("C:\test\test.txt")
        TextBox1.Text = sr.ReadToEnd

        sr.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim Write As String
        Dim sw As New StreamWriter("C:\test\test.txt", False)
        Write = Trim(TextBox1.Text)
        sw.WriteLine(Write)
        sw.Close()
    End Sub
0
jettman26
Asked:
jettman26
  • 2
  • 2
  • 2
1 Solution
 
BradVrudneyCommented:
This sounds like the same problem that you get with modal windows.   Try loading your page content inside an IFrame.  It should post back to itself then.
0
 
jettman26Author Commented:
Sorry, I am very new to any programming.  Not sure what an IFrame is or how you create one.
0
 
davidlars99Commented:
I think <frameset>...</frameset> would be much easier and better to maintain and create and of course some javascript will be involved as well...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
davidlars99Commented:
by the way here is a good example of actual working page that is designed the same way

http://www.frozendev.com

of course you don't have to do all that, it can be done much easier, just tell me what is the current functionality of your page
0
 
BradVrudneyCommented:
Try this:

This is the page that you will point your desktop to:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="ActiveDesktop.aspx.vb" Inherits="ActiveDesktop.ActiveDesktop"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
      <head>
            <title>ActiveDesktop</title>
            <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
            <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
            <meta name="vs_defaultClientScript" content="JavaScript">
            <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
      </head>
      <body ms_positioning="GridLayout">
            <form id="Form1" method="post" runat="server"><iframe src="ActiveDesktopIFrame.aspx" scrolling="yes" id="ActiveDesktopIFrame" name="ActiveDesktopIFrame"
                        style="MARGIN: 0px;WIDTH: 100%;HEIGHT: 100%" frameborder="no"></iframe>
            </form>
      </body>
</html>

And this is the page that will contain your actual page:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="ActiveDesktopIFrame.aspx.vb" Inherits="ActiveDesktop.ActiveDesktopIFrame"%>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en" >
<html>
      <head>
            <title>Desktop</title>
            <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
            <meta name="CODE_LANGUAGE" content="C#">
            <meta name="vs_defaultClientScript" content="JavaScript">
            <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
      </head>
      <body>
            <form id="Form1" method="post" runat="server">
                  <asp:button id="Button1" runat="server" text="Load"></asp:button>
                  <asp:button id="Button2" runat="server" text="Save"></asp:button>
                  <asp:textbox id="TextBox1" runat="server"></asp:textbox>
            </form>
      </body>
</html>

0
 
jettman26Author Commented:
Thanks  BradVrudney and everyone else!  This worked.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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