Click here to Skip to main content
14,361,340 members
   

ASP.NET

 
AnswerRe: Display a message when Radio Button is not selected Pin
Vincent Maverick Durano10-Apr-19 12:03
mveVincent Maverick Durano10-Apr-19 12:03 
QuestionMembership section of VS2017 Web config Pin
Member 87616678-Apr-19 3:02
memberMember 87616678-Apr-19 3:02 
Questionwhy's the error not found namespace or class ? Pin
Member 24584676-Apr-19 21:43
memberMember 24584676-Apr-19 21:43 
AnswerRe: why's the error not found namespace or class ? Pin
OriginalGriff7-Apr-19 21:07
protectorOriginalGriff7-Apr-19 21:07 
GeneralRe: why's the error not found namespace or class ? Pin
Member 245846723-Apr-19 17:39
memberMember 245846723-Apr-19 17:39 
GeneralRe: why's the error not found namespace or class ? Pin
Mycroft Holmes23-Apr-19 20:18
memberMycroft Holmes23-Apr-19 20:18 
GeneralRe: why's the error not found namespace or class ? Pin
OriginalGriff23-Apr-19 21:03
protectorOriginalGriff23-Apr-19 21:03 
Question.Net Core 2.2.3 with Angular, preparing for Docker Container Deployment with MongoDB running in a container, all Linux going crazy Pin
jkirkerx5-Apr-19 13:27
professionaljkirkerx5-Apr-19 13:27 
AnswerRe: .Net Core 2.2.3 with Angular, preparing for Docker Container Deployment with MongoDB running in a container, all Linux going crazy Pin
jkirkerx7-Apr-19 12:50
professionaljkirkerx7-Apr-19 12:50 
AnswerFinally figured it out! Pin
jkirkerx11-Apr-19 13:47
professionaljkirkerx11-Apr-19 13:47 
QuestionMy div repeated 3 times if format its css if use form runas server Pin
Ashraf Khalifah5-Apr-19 0:25
memberAshraf Khalifah5-Apr-19 0:25 
AnswerRe: My div repeated 3 times if format its css if use form runas server Pin
Vinod Jangle11-Apr-19 9:48
memberVinod Jangle11-Apr-19 9:48 
Question(SOLVED) WHy is my image not displaying on a certain page? Pin
samflex3-Apr-19 7:28
membersamflex3-Apr-19 7:28 
AnswerRe: WHy is my image not displaying on a certain page? Pin
Richard Deeming3-Apr-19 8:48
mveRichard Deeming3-Apr-19 8:48 
GeneralRe: WHy is my image not displaying on a certain page? Pin
samflex3-Apr-19 10:56
membersamflex3-Apr-19 10:56 
GeneralRe: WHy is my image not displaying on a certain page? Pin
Richard Deeming3-Apr-19 23:00
mveRichard Deeming3-Apr-19 23:00 
GeneralRe: WHy is my image not displaying on a certain page? Pin
samflex4-Apr-19 6:59
membersamflex4-Apr-19 6:59 
QuestionLoad event fires twice and QueryString becomes empty!! Pin
pldelosrios2-Apr-19 4:41
memberpldelosrios2-Apr-19 4:41 
Hello,

I'm trying to do one page with two listboxes that filers one grid.
The only requirement is that the selection made by the user must be reflected in the URL so that it can be sent by mail to colleagues with the selection already made


The problem is that Load event fires twice.
First time all parameters are transmitted correctly.
The second time the whole QueryString disappears!!

ASPX Directive:
<%@ Page 
	Language="vb" 
	uiCulture="en-US" 
	culture="de-DE"
	MasterPageFile="XTAB_WO.master" 
	AutoEventWireup="false" 
	CodeFile="LC1vsLC2.vb"
	Inherits="LC1vsLC2" 
	ClientIDMode="Predictable"
%>  


ASPX Code:

<asp:listbox clientidmode="Static" id="LstTipo" style="width:150px;height:100px;" runat="server" datasourceid="SqlDataSource2" datatextfield="FLD_RESULTADO" datavaluefield="FLD_RESULTADO">
<asp:listbox clientidmode="Static" id="LstTMA" style="width:150px;height:100px;" runat="server" datasourceid="SqlDataSource4" datatextfield="FLD_MOD3" datavaluefield="FLD_MOD3">
<dx:ASPxGridView ID="gridview1" runat="server" AutoGenerateColumns="true" DataSourceID="SqlDataSource1">
</dx:ASPxGridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyCCnn %>"></asp:SqlDataSource>
<asp:Button ID="Button1" runat="server" Text="Select" style="width:150px;" OnClientClick="Populate();"/>
	<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
		ConnectionString="<%$ ConnectionStrings:hacheConnectionString %>" 
		SelectCommand="select '(ALL)' FLD_RESULTADO UNION ALL select distinct FLD_RESULTADO from XXXXXXXXXXXXX">
	</asp:SqlDataSource>
	<asp:SqlDataSource ID="SqlDataSource4" runat="server" 
		ConnectionString="<%$ ConnectionStrings:hacheConnectionString %>" 
		SelectCommand="select '(ALL)' FLD_MOD3 UNION ALL select distinct FLD_MOD3 from XXXXXXXXXXXXX">
	</asp:SqlDataSource>
    <script type="text/javascript" language="javascript">
        function removeParam(key, sourceURL) {
            var rtn = sourceURL.split("?")[0],
			param,
			params_arr = [],
			queryString = (sourceURL.indexOf("?") !== -1) ? sourceURL.split("?")[1] : "";
            if (queryString !== "") {
                params_arr = queryString.split("&");
                for (var i = params_arr.length - 1; i >= 0; i -= 1) {
                    param = params_arr[i].split("=")[0];
                    if (param === key) {
                        params_arr.splice(i, 1);
                    }
                }
                rtn = rtn + "?" + params_arr.join("&");
            }
            return rtn;
        }     

        function Populate() {
            var tma = document.getElementById("LstTMA");
            var tipo = document.getElementById("LstTipo");
            var fe = "";
            var miurl="";
            var miurlIni="";
            var valor = "";
						
	    miurlIni = window.top.location.href + "?";


            if (tipo.selectedIndex >= 0) {
                var selectedtipo = tipo.options[tipo.selectedIndex].text;
                miurl = removeParam("tipo", miurl);
                valor = (selectedtipo == "(ALL)") ? '0' : selectedtipo;
                miurl = miurl + "&tipo=" + valor.replace(" ","_");
            }

            if (tma.selectedIndex >= 0) {
                var selectedtma = tma.options[tma.selectedIndex].text;
                miurl = removeParam("tma", miurl);
                valor = (selectedtma == "(ALL)") ? '0' : selectedtma;
                miurl = miurl + "&tma=" + valor;
            }

            window.top.location.href = miurlIni + miurl.substring(1,999);
        }
    </script>   



CODE-BEHIND:


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim q As String, q_count As String, x As Integer, NumR As Long
        Dim dv As Object

        Dim mpContentPlaceHolder As ContentPlaceHolder
        Dim ddlRp As ASPxRoundPanel
        Dim LstTipo As ListBox, StTipo As String
        Dim LstTMA As ListBox, StTma As String


        mpContentPlaceHolder = CType(Master.FindControl("ContentHolder"), ContentPlaceHolder)
        If Not mpContentPlaceHolder Is Nothing Then
            ddlRp = CType(mpContentPlaceHolder.FindControl("ASPxRoundPanel3"), ASPxRoundPanel)
            If Not ddlRp Is Nothing Then
                LstTipo = CType(ddlRp.FindControl("LstTipo"), ListBox)
                LstTMA = CType(ddlRp.FindControl("LstTMA"), ListBox)
            End If
        End If

        If Request.QueryString.Count > 0 AndAlso ((Not Request.QueryString("pais") Is Nothing) Or (Not Request.QueryString("y4m2d2") Is Nothing) Or (Not Request.QueryString("tipo") Is Nothing) Or (Not Request.QueryString("tma") Is Nothing)) Then
            StTipo = "" : StTma = "" ': Sty4m2d2 = "" 

            If Not (Request.QueryString("tipo") Is Nothing) AndAlso Request.QueryString("tipo").ToString() <> "" Then
                If Request.QueryString("tipo") = "0" Then
                    LstTipo.SelectedValue = "(ALL)"
                    StTipo = ""
                Else
                    LstTipo.SelectedValue = Replace(Request.QueryString("tipo"), "_", " ")
                    StTipo = " AND FLD_RESULT='" & Replace(Request.QueryString("tipo"), "_", " ") & "'"
                End If
            End If

            If Not (Request.QueryString("tma") Is Nothing) AndAlso Request.QueryString("tma").ToString() <> "" Then
                If Request.QueryString("tma") = "0" Then
                    LstTMA.SelectedValue = "(ALL)"
                    StTma = ""
                Else
                    LstTMA.SelectedValue = Replace(Request.QueryString("tma"), "_", " ")
                    StTma = " AND FLD_MOD3='" & Replace(Request.QueryString("tma"), "_", " ") & "'"
                End If
            End If

            q = "SELECT " & StFieldsQuery & " FROM V_BUDA_LC1vsLC2 WHERE 1=1 " & StTipo & StTma '& Sty4m2d2 '& " ORDER BY FLD_ID"
            q_count = "SELECT count(*) NumR FROM V_BUDA_LC1vsLC2 where 1=1 " & StTipo & StTma '& Sty4m2d2

            SqlDataSource11.SelectCommand = q_count

            dv = CType(SqlDataSource11.Select(DataSourceSelectArguments.Empty), DataView)
            NumR = CType(dv.Table.Rows(0)(0), Integer)
            If (NumR > 0) Then
                SqlDataSource1.SelectCommand = q

                gridview1.Visible = True
                LblNoData.Visible = False
            Else
                gridview1.Visible = False
                LblNoData.Visible = True
            End If
        Else
            gridview1.Visible = True
            LblNoData.Visible = False

            q = "SELECT * FROM V_BUDA_LC1vsLC2 WHERE 1=0"
            SqlDataSource1.SelectCommand = q
        End If

        Page.DataBind()
    End Sub

SuggestionRe: Load event fires twice and QueryString becomes empty!! Pin
Richard Deeming2-Apr-19 9:16
mveRichard Deeming2-Apr-19 9:16 
QuestionError 550 Permission denied: Windows Server 7 FTP Server ? Pin
Member 245846722-Mar-19 19:13
memberMember 245846722-Mar-19 19:13 
GeneralRe: Error 550 Permission denied: Windows Server 7 FTP Server ? Pin
Richard MacCutchan23-Mar-19 0:10
protectorRichard MacCutchan23-Mar-19 0:10 
GeneralRe: Error 550 Permission denied: Windows Server 7 FTP Server ? Pin
Member 245846724-Mar-19 19:35
memberMember 245846724-Mar-19 19:35 
QuestionWant to find out differences between two branches (local or remote) in Git Pin
simpledeveloper22-Mar-19 21:47
membersimpledeveloper22-Mar-19 21:47 
AnswerRe: Want to find out differences between two branches (local or remote) in Git Pin
Richard MacCutchan23-Mar-19 3:29
protectorRichard MacCutchan23-Mar-19 3:29 
QuestionMessage Closed Pin
20-Mar-19 1:08
memberMember 1281182220-Mar-19 1:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.