home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / util / srcctrlwin.aspx < prev    next >
Encoding:
Text File  |  2000-06-08  |  1.1 KB  |  36 lines

  1.  
  2. <%@ Register TagPrefix="Acme" TagName="SourceCtrl" Src="/quickstart/util/SrcCtrl.aspx"%>
  3. <%@ Import Namespace="System.Text" %>
  4. <%@ Import Namespace="System.IO" %>
  5.  
  6.     <link rel="stylesheet" href="/quickstart/util/style.css">
  7.  
  8.     <script language="C#" runat="server">
  9.  
  10.       public void Page_Load (Object sender, EventArgs e)
  11.       {
  12.               String path = Request.QueryString["path"];
  13.  
  14.               if (path == null) 
  15.               {
  16.                   ErrorMessage.InnerHtml = "Please specify a path variable in the querystring.";
  17.                   return;
  18.               }
  19.  
  20.               String file = Request.QueryString["file"];
  21.  
  22.               if (file != null) {
  23.                   String dir = File.GetDirectoryNameFromPath(path);
  24.                   MySourceCtrl.filename = Server.MapPath(dir + "\\" + file);
  25.               }
  26.       }
  27.  
  28.     </script>
  29.  
  30.     <form runat="server">
  31.  
  32.         <Acme:SourceCtrl id="MySourceCtrl" showfilename="true" runat="server" />
  33.         <span style="color:red" id="ErrorMessage" runat="server"/>
  34.  
  35.     </form>
  36.