Client side jscript issue



Working in Visual Studio

Objective: I am trying to have my server side vb code construct a file name
for use with my client side JavaScript code to then save the file to the
web. My saving to the web method is working with a preset test filename.



The issue I have is that when I put this JavaScript in the source code of an
asp:content holder of a masterpage container, it is not able to see any
server side controls, one of which is returning my filename I want to use.



In a standard HTML page where I worked out the code method it works fine, so
I know the method works.



It is only in asp:content page, where there is no HTML that I cannot read
the server side control.



I can read a HTMLInputText control in the asp:content page so long as it is
not set to runat="server", but then my server side vb code cannot see it to
write my file name to it for use with the JavaScript code.



I either need a way to read the server side control from the asp:content
page with JavaScript, or write to the HTMLInputText control not set to
runat="server" when the server responds, or a different approach that allows
me to get my filename in a way that the JavaScript can read it.



Here is a snippet of the code up to where the error on page occurs:



<%@ Page Language="VB" MasterPageFile="MasterPage.master"
AutoEventWireup="false" MaintainScrollPositionOnPostback ="true"
CodeFile="APcontent.aspx.vb" Inherits="APcontent" title="Accounts Payable"
%>



<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">





<script language="javascript" type="text/javascript">

// <!CDATA[

function File1_onclick() {

var Var1 = document.getElementById("TextBox1").value; 'ERROR OCCURS HERE

document.write(Var1);

//File saving code is here.

}

// ]]>

</script>



<asp:TextBox ID="TextBox1" runat="server"
Width="472px"></asp:TextBox>





</asp:Content>


.



Relevant Pages

  • Re: Client side jscript issue
    ... I am trying to have my server side vb code construct a file name ... for use with my client side JavaScript code to then save the file to the ... I can read a HTMLInputText control in the asp:content page so long as it is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Pattern based test isnt working, but it works elsewhere
    ... including a drop down select control which has ... Now, the function test_nws, when used in a static web page with a much ... and no data is submitted to the server. ... there (I used the third edition of "JavaScript: ...
    (comp.lang.javascript)
  • Client side jscript issue
    ... I am trying to have my server side vb code construct a file name ... for use with my client side JavaScript code to then save the file to the ... My saving to the web method is working with a preset test filename. ... I can read a HTMLInputText control in the asp:content page so long as it is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Tier3 today - And Flex-it like NASDAQ (*Only better!*)
    ... FlexBuilder, or just working on the FABridge functionality in general, you ... ArrayCollections are completely accessible via the Javascript in ... Broadcasted server to client messages, ...
    (comp.os.vms)
  • Re: Web User Control - fire function from client side
    ... client (i.e. javascript) or on the server (i.e. inside the form control). ... postback from javascript and integrating it with a user control. ...
    (microsoft.public.dotnet.framework.aspnet)

Loading