Wrox Programmer Forums
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) 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 December 4th, 2003, 05:58 PM
Registered User
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MM:DataSet mystery

Can anyone tell me how to use the Expression attribute of MM:Dataset to stop the CommandText from executing on Page_Load?

My code:
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_STRING_DeathStarPERMPLUSRead"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings["MM_CONNECTION_DATABASETYPE_DeathStarPERMPLUSR ead"] %>'
CommandText='<%# "SELECT * FROM dbo.v_InspectionHistory WHERE PermitNo = @Year;" %>'
Expression='<%# Page.IsPostBack %>'
Debug="true" PageSize="15">

according to Macromedia, Expression='<%# Page.IsPostBack %>' should stop the Dataset from executing unless the page is postback. However it is still executing on Page_Load. I would like it to execute when a button is pressed.

Anyone know how to do this??

Old December 10th, 2003, 01:56 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts

I'm not sure how dreamweaver handles 'Expression'. But page.isPostBack will either return true or false.

you can use:

If NOT IsPostBack Then
   call the sub here
End If

Please post your code in the page_load sub.
Old January 12th, 2004, 10:44 PM
Registered User
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Expression in Dreamweaver datasets is boolean and indicates if the dataset should be executed. In your example, the expression should be false until the postback. However...if you have autopostback enable on the page...it could become true unexpectedly. I would recommend that you change the dateset to:


and use the following statement to execute the dataset within your subroutine


Hope this helps

Similar Threads
Thread Thread Starter Forum Replies Last Post
for-each looping - mystery comma return Navy1991_1 XSLT 6 June 5th, 2008 01:52 PM
String Mystery binishkhan87 C# 3 October 6th, 2007 04:19 PM
error mystery htummala Oracle 2 February 28th, 2005 02:28 AM
MM:dataset must databind when postback zzzz8888 ASP.NET 1.0 and 1.1 Basics 2 May 29th, 2004 12:39 AM

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