Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: The Controls collection cannot be modified because the control contains code blocks (i.e. ). WITH A TWIST [27709]

$
0
0
ok so I get the
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). error when trying to use the calendar extender. see below. Now on the page I have inherited some client side java where it accesses the Session.Timeout env var

so how do I get rid of the var sessionTimeout = "<%= Session.Timeout %>";

and still have it work??? right now I just have var sessionTimeout = 60;

<script language="javascript" type="text/javascript">
var sessionTimeout = "<%= Session.Timeout %>";
var sessionTimeoutWarning = parseInt(sessionTimeout) - 5;

var sTimeoutWarning = parseInt(sessionTimeoutWarning) * 60 * 1000;
var sTimeout = parseInt(sessionTimeout) * 60 * 1000;
setTimeout('SessionWarning()', sTimeoutWarning);
setTimeout('SessionTimeout()', sTimeout);

function SessionWarning() {
var current_time = new Date();
var message = "Your session will expire in another " +
(parseInt(sessionTimeout) - sessionTimeoutWarning) +
" mins! Please Save the data before the session expires. " + current_time.toTimeString();
alert(message);
}

function SessionTimeout() {
var message = "Your session has expired! Logon again!";
window.location = "../../../Eureka/Login.aspx";
alert(message);
}
</script>



<cc1:ExtendedTextBox CssClass="thinBorder" TabIndex="41" UseClientRegex="true"
MatchRegEx="^(((((0?[1-9]{1})|([1][012]))/(([012]?[1-9]{1})|([3][01])|[12][0]|[9]{2})|([9]{2}/[9]{2}))/((([1]{1}[089]{1})|([2]{1}[0-9]{1}))[0-9]{1}[0-9]{1}))|([9]{2}/[9]{2}/[9]{4})|([0]{2}/[0]{2}/[0]{4})){1}$"
RegexDescription="Date Required: mm/dd/yyyy" ID="txtDateOfAdmission" runat="server"
MaxLength="10" Width="153px" />


<cc2:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateOfAdmission">
</cc2:CalendarExtender>
Comments: sorry that was 2 jobs ago I no longer have access to the project. what is boils down too is "<%= Session.Timeout %>"; <% classic asp style is not usable try <#

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>