Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2004, 09:42 AM
Authorized User
 
Join Date: Nov 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to seanmayhew
Default File Manager Javascript in User Control

In the File Manager project im trying to move the code for creating a new directory into the Header User control. I've moved the CreateDir in the Header user control of the file manager. I know this has to do with my targeting as I get the javascript error:

document.forms.BrowseFiles.elements.funcParam is null or not an object

Here is the relevant page code when viewing source (after page parsing)
Code:
<input name="Header:funcParam" id="Header_funcParam" type="hidden" />
<table class="MenuTable" border="0" width="100%">
  <tr>
   <td>
    <a href="javascript:CreateDir();">
    <img border="0" src="./Images/NewFolder.gif" />
    </a>
    <a id="Header_CreateDir" href="javascript:__doPostBack('Header$CreateDir','')">
    </a>
   </td>
  </tr>
</table>
and here is the javascript:
Code:
<script language="javascript">
function CreateDir()
{
   dirName = prompt('Type the name of the directory:','');
   if((dirName) && (dirName!=""))
   {
   document.forms['BrowseFiles'].elements['funcParam'].value = dirName;
   __doPostBack('CreateDir','');
   }
</script>
Here is the __doPostBack javascript
Code:
<script language="javascript">
<!--
    function __doPostBack(eventTarget, eventArgument) {
        var theform;
        if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
            theform = document.forms["BrowseFiles"];
        }
        else {
            theform = document.BrowseFiles;
        }
        theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
        theform.__EVENTARGUMENT.value = eventArgument;
        theform.submit();
    }
// -->
</script>
Any help would be greatly appreciated.






Similar Threads
Thread Thread Starter Forum Replies Last Post
textbox value using javascript on user control k.manisha ASP.NET 1.0 and 1.1 Professional 1 February 12th, 2007 04:48 PM
Access a web user control from javascript? shenku ASP.NET 1.0 and 1.1 Professional 3 July 21st, 2005 07:24 AM
Calling procedure of User Control from aspx file vskumar VB.NET 1 February 15th, 2005 11:17 AM
user manager junemo PHP How-To 0 May 6th, 2004 03:45 AM
User Control & Javascript smrao0906 Wrox Book Feedback 1 October 9th, 2003 08:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.