PDA

View Full Version : [CLOSED] How to access server side variable in XScript



randhir
Dec 07, 2013, 12:00 AM
<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Main.Master" CodeBehind="Test.aspx.vb" Inherits="ABConnect.Test" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<abx:ABXScript ID="XScript1" runat="server">
<script type="text/javascript">
var textSelection = {
documentDownloadTitleText: <%= CultureResources.common_TooManySections%>
}

</script>
</abx:ABXScript>
<div class="mainContentAreaBorderedTop_NoTab"></div>
<div class="mainContentAreaBordered">
<input id="Button2" type="button" value="textSelection.documentDownloadTitleText;" />

</div>
</asp:Content>

randhir
Dec 07, 2013, 12:03 AM
The <%= CultureResources.common_TooManySections%> is not getting recognized in javascript.

geoffrey.mcgill
Dec 07, 2013, 1:00 AM
If the following is outputing a string, then you should wrap in quotes:


documentDownloadTitleText: '<%= CultureResources.common_TooManySections%>'

geoffrey.mcgill
Dec 07, 2013, 1:00 AM
When posting code samples to the forums, please ensure you wrap your code samples in [CODE] tags.