Skip to main content
New Participant
August 20, 2024
Question

DropDown gets refreshed from DW.DataSet. Also need alter DataSetCommandText to filter from dropdown

  • August 20, 2024
  • 2 replies
  • 414 views
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
--Getting rows from Dataset for Grid
<MM:DataSet id="DSGRID" runat="Server" Debug="true" ConnectionString='' DatabaseType=''
CommandText='<%# "SELECT Manager,.... from ..." %>'
></MM:DataSet>
 
--Getting rows from Dataset for DropDown 
<MM:DataSet id="dsDropDown" runat="Server" Debug="true" ConnectionString='' DatabaseType=''
CommandText='<%# "SELECT Manager from ..." %>'
></MM:DataSet>
 
--Populate DropDown from DataSet
<asp:DropDownList ID="ddlManager" DataSource='<%# dsGrid.DefaultView %>' runat="server" autopostback="true" ENABLEVIEWSTATE="TRUE" ">  
</asp:DropDownList> 
 
--Populate Grid from DataSet
<ASP:Repeater runat="server" DataSource='<%# dsGrid.DefaultView %>' >
 
INTRO
I am using Dreamweaver with tag MM to create 2 DataSet objects for a drop down & a grid. The drop down is used to filter the grid.
Currently the drop down and grid statically displays all date. The issues is:-
 
1) The drop down refreshes the screen and its selected value gets reset only because I think the dataset is refreshed and refreshes the drop down.
How to avoid this, If there is a way to do something like this:-
<% If !PostBack
Create DataSet
Populate the ddlManager
else 
--dont refresh the dataset or dropdown
End If
%>
 
2) How to dynamically filter the Grid with selection from drop down. Or how to alter the dataset to include the filter from drop down selection
If there is a way to insert a WHERE clause comparing the drop down value, like this:-
<MM:DataSet id="DSGRID" 
CommandText='<%# "SELECT Manager,.... from ...<%WHERE MANAGER='DDLMANAGER.VALUE'%>" %>'
></MM:DataSet>
    This topic has been closed for replies.

    2 replies

    BenPleysier
    Community Expert
    August 21, 2024

    In all honesty, you are using an outdated workflow for your application. A better, more secure and faster way to create a web application today is to use web API's.  This will result in the features that you are looking for.

     

    Have a look at https://dotnet.microsoft.com/en-us/apps/aspnet/apis for what this is about.

     

    A tool that will create the ASP.net API's automatically, without hand coding, is Wappler.

     

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    jeba_2458Author
    New Participant
    August 21, 2024

    Thanks for your response but, we do not have the time and budget for that.

    There is a viewstate and the drop down gets refreshed each time there is a post back.

    I kinda sorta managed question #2, but need fix on question #1.

    jeba_2458Author
    New Participant
    August 21, 2024

    I meant to say... EVENTHOUGH there is a viewstate the drop down STILL gets refreshed each time....

    Nancy OShea
    Community Expert
    August 20, 2024

    Which version of Dreaweaver?

     

    Dynamic Content Sources:

    https://helpx.adobe.com/dreamweaver/using/dynamic-content-sources-overview.html

     

    Nancy O'Shea— Product User, Community Expert & Moderator
    jeba_2458Author
    New Participant
    August 20, 2024

    Adobe dreamweaver 21.1