如何使用隐形调用填充vb.net下拉列表 [英] How to fill vb.net dropdownlist with stealth call

查看:52
本文介绍了如何使用隐形调用填充vb.net下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我之前已经问过这个问题,但我被要求再次发布更多信息。我上一个问题的链接如下。



如何在VB.NET中构造DropDownList [ ^ ]



我会尝试尽可能地解释并提供所有相关信息。



我的应用程序中有一个搜索页面,搜索结果表中有按钮您可以使用它来查看更多信息。其中一个按钮调用另一个页面,该页面在显示数据的搜索页面上显示为弹出窗口。



在这个秘密页面上,我有一个呈现的表格哪个工作正常,但我也需要一个下拉列表,填充下拉列表的数据来自我有的SQL函数,但我似乎无法填充下拉列表。



我会发布我的所有代码,所以我很抱歉这将是非常多的但我真的需要帮助,因为我一直试图这样做几天没有成功。



这是我的搜索页面HTML侧的代码...



Hi All,

I have asked this question before but i have been asked to post again with better information. the link for my previous question is below.

How to construct DropDownList in VB.NET[^]

I will try to explain as best as possible and to give all the relevant information.

I have a search page in my application and after doing a search there are buttons within the results table that you can use to see further information. One of the buttons makes a call to another page which comes up as a popup on the search page displaying data.

On this stealth page i have a table that is rendered which works fine but i need a drop down list also and the data to fill the drop down list comes from a SQL function i have but i cannot seem to populate the drop down list.

I will post all my code so i apologize that it will be quite a lot but i really need help with this as i have been trying to do this for days now with no success.

This is the code on my search page HTML side...

<%@ Page Title="" Language="VB" MasterPageFile="~/UsermanMast.master" AutoEventWireup="false" CodeFile="UserSearch.aspx.vb" Inherits="UserInfo"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <link href="StyleSheet.css" rel="stylesheet" />
    <script type='text/javascript' ></script>
    <script src="js/external/jquery/jquery.js"></script>
    <script src="js/jquery-ui.min.js"></script>



    <script>
        $(function () {
            $("#dEditdob").datepicker({
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                yearRange: '-100y:c+nn',
                maxDate: '-1d'
            });
        });
    </script>



    <div id="dUserSystems" runat="server" >
            <u>Systems user has access to</u><br />
                <div id="dUserData"></div>
            <br />

        <div id="ddlSysData" runat="server" >
             <u>Add new system to users account</u><br />
             <asp:DropDownList ID="sysDDL" runat="server"/>
        </div>
            <br />
            <input type="button" id="butAdd" value="Add" runat="server"/>&nbsp;
            <input type="button" onclick="butClose()" value="Close" />
    </div>



    <div id="dUserEdit" runat="server">
        <table>
            <tr>
                <td>
                Edit User Details
                </td>
            </tr>
            <tr>
                <td>
                    Login ID
                </td>
                <td>
                    <input id="dEditlogin" type="text" disabled="disabled" />
                </td>
            </tr>
            <tr>
                <td>
                    Staff ID
                </td>
                <td>
                    <input id="dEditstaff" type="text" maxlength="20" />
                </td>
            </tr>
            <tr>
                <td>
                    Surname
                </td>
                <td>
                    <input id="dEditsurname" type="text" maxlength="40"/>
                </td>
            </tr>
            <tr>
                <td>
                    First Name
                </td>
                <td>
                    <input id="dEditfirstn" type="text" maxlength="30"/>
                </td>
            </tr>
            <tr>
                <td>
                    Middlename
                </td>
                <td>
                    <input id="dEditmiddle" type="text" maxlength="40"/>
                </td>
            </tr>
            <tr>
                <td>
                    Date of Birth
                </td>
                <td>
                    <input id="dEditdob" type="text" maxlength="20" readonly="readonly" />
                </td>
            </tr>
            <tr>
                <td>
                    Prof Number
                </td>
                <td>
                    <input id="dEditprof" type="text" maxlength="20"/>
                </td>
            </tr>
            <tr>
                <td>
                    Job Title
                </td>
                <td>
                    <input id="dEditjob" type="text" maxlength="60"/>
                </td>
            </tr>
            <tr>
                <td>
                    Department
                </td>
                <td>
                    <input id="dEditdept" type="text" maxlength="60"/>
                </td>
            </tr>
            <tr>
                <td>
                    Site
                </td>
                <td>
                    <input id="dEditsite" type="text" maxlength="60"/>
                </td>
            </tr>
        </table>
        <input type="button" onclick="butUpdate()" value="Update"  />
         <input type="button" onclick="butCancel()" value="Close"  />
    </div>



    <div id="dUpdatemsg" runat="server">
        <div id="dMsg"></div>
        <input type="button" id="updateClose" onclick="msgClose()" value="Ok" />
    </div>





   <%--  <div id="dialog" title="Basic Dialog" style="display: none;">
        <p id="alertmsg">test msg</p>
    </div>--%>

    <br />

        <div id="userSearchForm">

            <div id="sHeader">
                 <asp:Label ID="uHeader" runat="server" Text="User Search"></asp:Label><br />
            </div>

            <div id="searchTest">

                <div id="userTitles">

                    <div id="slogin">
                        <label for="sLoginid">Login ID</label>
                    </div>
                    <div id="sfName">
                        <label for="sfirstName">First Name</label>
                    </div>
                    <div id="slName">
                        <label for="slastName">Surname</label>
                    </div>
                    <div id="sEsrNumb">
                        <label for="sESRNumber">ESR Number</label>
                    </div>
                    <div id="sProfNumb">
                        <label for="sprofNumber">Prof No</label>
                    </div>

              </div>

              <div id="sInput">

                <div id="sLoginInput">
                    <input id="sLoginid" name="sUserId" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br />
                </div>
                <div id="sFnameInput">
                    <input id="sfirstName" name="sfirstName" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br />
                </div>
                <div id="slNameInput">
                    <input id="slastName" name="slastName" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br />
                </div>
                <div id="sEsrInput">
                    <input id="sESRnumber" name="sESRnumber" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br />
                </div>
                <div id="sProfInput">
                    <input id="sprofNumber" name="sprofNumber" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br />
                </div>
              </div>
           </div>
      </div>
                <br />


               <div id="sButtons">
                    <asp:Button ID="buttonSearch" class="showSystemsPop" runat="server" Text="Search" Width="107px" />&nbsp;&nbsp;

               </div>


                    <br />
                    <br />

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <asp:Button ID="adNewUser" runat="server" Text="Add User" Width="107px" Visible="false"  />


    <br />


    <br />

        <div id ="content">
            <asp:PlaceHolder ID="placeResults" runat="server"></asp:PlaceHolder>
            <asp:Label ID="noResultOutput" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="Larger" ForeColor="#FF3300" CssClass="noResult"></asp:Label>
                    </div>








<script>



    //Function used to grab users details when admin is looking to update details
    function editUser(loginid, staffid, surname, firstname, middlename, dob, profnumb, jobtitle, department, site) {

        $("#dEditlogin").val(loginid.replace(/\#/g, " "));
        $("#dEditstaff").val(staffid.replace(/\#/g, " "));
        $("#dEditsurname").val(surname.replace(/\#/g, " "));
        $("#dEditfirstn").val(firstname.replace(/\#/g, " "));
        $("#dEditmiddle").val(middlename.replace(/\#/g, " "));
        $("#dEditdob").val(dob.replace(/\#/g, " "));
        $("#dEditprof").val(profnumb.replace(/\#/g, " "));
        $("#dEditjob").val(jobtitle.replace(/\#/g, " "));
        $("#dEditdept").val(department.replace(/\#/g, " "));
        $("#dEditsite").val(site.replace(/\#/g, " "));

            $("#ContentPlaceHolder1_dUserEdit").css("left", "200px");
            $("#ContentPlaceHolder1_dUserEdit").css("display", "block");

     }

    function butCancel() {
        $("#ContentPlaceHolder1_dUserEdit").css("display", "none");
    }


    //Function used to update user details
    function butUpdate() {

        var vUserid = escape($("#dEditlogin").val());
        var vStaffid = escape($("#dEditstaff").val());
        var vSurname = escape($("#dEditsurname").val());
        var vFirstname = escape($("#dEditfirstn").val());
        var vMiddlename = escape($("#dEditmiddle").val());
        var vDateofbirth = escape($("#dEditdob").val());
        var vProfnumb = escape($("#dEditprof").val());
        var vJobtitle = escape($("#dEditjob").val());
        var vDepartment = escape($("#dEditdept").val());
        var vSite = escape($("#dEditsite").val());

        var link = 'EditUser.aspx?userid=' + vUserid + '&staffid=' + vStaffid + '&surname=' + vSurname + '&firstname=' + vFirstname + '&middlename=' + vMiddlename + '&dob=' + vDateofbirth + '&profnumb=' + vProfnumb + '&jobtitle=' + vJobtitle + '&department=' + vDepartment + '&site=' + vSite;


        $.get(link, function (data) {
            $("#dMsg").empty().append(data);
            $("#ContentPlaceHolder1_dUpdatemsg").css("left", "200px");
            $("#ContentPlaceHolder1_dUpdatemsg").css("display", "block");
            });


    }


    function msgClose() {
        document.location.href = "UserSearch.aspx";

    }


    //Function used to grab list of systems user has access to
    function viewSystems(myUserid) {


        var link = 'fetchData.aspx?userid=' + myUserid;

        $.get(link, function (data) {

            $("#dUserData").empty().append(data);
            $("#ContentPlaceHolder1_dUserSystems").css("left", "200px");
            $("#ContentPlaceHolder1_dUserSystems").css("display", "block");
        });


      }

    function butClose() {
        $("#ContentPlaceHolder1_dUserSystems").css("display", "none");
    }



    function delUser(delUserid) {

        if (confirm("Are you sure you want to delete? This action cannot be undone.")){

            var link = 'DeleteUser.aspx?userid=' + delUserid

            $.get(link, function (data) {

            });
        }
        else
        {
            return false;
        }



    }


</script>


</asp:Content>





On this page the two parts that refer to the stealth page are a



On this page the two parts that refer to the stealth page are a

and a JavaScript function...



and a JavaScript function...

<div id="dUserSystems" runat="server" >
           <u>Systems user has access to</u><br />
               <div id="dUserData"></div>
           <br />

       <div id="ddlSysData" runat="server" >
            <u>Add new system to users account</u><br />
            <asp:DropDownList ID="sysDDL" runat="server"/>
       </div>
           <br />
           <input type="button" id="butAdd" value="Add" runat="server"/>&nbsp;
           <input type="button" onclick="butClose()" value="Close" />
   </div>







function viewSystems(myUserid) {





var link = ’fetchData.aspx?userid=’ + myUserid;



$.get(link, function (data) {



$(\"#dUserData\").empty().append(data);

$(\"#ContentPlaceHolder1_dUserSystems\").css(\"left\", \"200px\");

$(\"#ContentPlaceHolder1_dUserSystems\").css(\"display\", \"block\");

});





}



function butClose() {

$(\"#ContentPlaceHolder1_dUserSystems\").css(\"display\", \"none\");

}



The button within the search result is created as below with onclick event linked to the function above...



bt3 = New HtmlGenericControl(\"div\")

bt3.InnerHtml = \"<input type=button onclick=viewSystems(’\" & dt.Item(\"login_id\").ToString & \"’) value=’View systems’>\"





This code is from the stealth page where my table data is cr eated...






function viewSystems(myUserid) {


var link = 'fetchData.aspx?userid=' + myUserid;

$.get(link, function (data) {

$("#dUserData").empty().append(data);
$("#ContentPlaceHolder1_dUserSystems").css("left", "200px");
$("#ContentPlaceHolder1_dUserSystems").css("display", "block");
});


}

function butClose() {
$("#ContentPlaceHolder1_dUserSystems").css("display", "none");
}

The button within the search result is created as below with onclick event linked to the function above...

bt3 = New HtmlGenericControl("div")
bt3.InnerHtml = "<input type=button onclick=viewSystems('" & dt.Item("login_id").ToString & "') value='View systems'>"


This code is from the stealth page where my table data is created...

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

    'Add session check here

    If Request.QueryString("userid") <> "" Then

        Dim dsResults As New DataSet
        Dim dt As DataTableReader

        dsResults = GetUserName.systemData(Request.QueryString("userid").ToString)
        dt = dsResults.CreateDataReader

        Dim dv As New HtmlGenericControl("div")
        dv.ID = "sysData"

        Dim tb As New Table
        Dim tr As New TableRow
        Dim tc As New TableCell
        Dim lb As New Label
        Dim iCount As Integer = 1

        If dt.HasRows = True Then

            tr = New TableRow
            tr.CssClass = "tabHeader"
            tc = New TableCell
            tc.CssClass = "tabCell"
            lb = New Label

            lb.Text = "System Name"
            tc.Controls.Add(lb)
            tr.Controls.Add(tc)
            tb.Controls.Add(tr)

            tr.CssClass = "tabHeader"
            tc = New TableCell
            tc.CssClass = "tabCell"
            lb = New Label

            lb.Text = "Date Added"
            tc.Controls.Add(lb)
            tr.Controls.Add(tc)
            tb.Controls.Add(tr)


            tr.CssClass = "tabHeader"
            tc = New TableCell
            tc.CssClass = "tabCell"
            lb = New Label

            lb.Text = "Added By"
            tc.Controls.Add(lb)
            tr.Controls.Add(tc)
            tb.Controls.Add(tr)

            Do While dt.Read

                tr = New TableRow

                If iCount = 1 Then
                    tr.CssClass = "rowStyle3"
                    iCount = 0
                Else
                    tr.CssClass = "rowStyle4"
                    iCount = 1
                End If

                'tr = New TableRow
                tc = New TableCell
                tc.CssClass = "rowCell2"
                lb = New Label

                lb.Text = dt.Item("description").ToString()
                tc.Controls.Add(lb)
                tr.Controls.Add(tc)
                tb.Controls.Add(tr)

                'tr = New TableRow
                tc = New TableCell
                tc.CssClass = "rowCell2"
                lb = New Label


                lb.Text = dt.Item("date_added").ToString()
                tc.Controls.Add(lb)
                tr.Controls.Add(tc)
                tb.Controls.Add(tr)

                'tr = New TableRow
                tc = New TableCell
                tc.CssClass = "rowCell2"
                lb = New Label

                lb.Text = dt.Item("added_by").ToString()
                tc.Controls.Add(lb)
                tr.Controls.Add(tc)
                tb.Controls.Add(tr)
            Loop
            dt.Close()
            dsResults.Dispose()


            dv.Controls.Add(tb)
            sysData.Controls.Add(dv)
        Else
            Response.Write("User has not been allocated access to any systems")
        End If

    End If

    If Request.QueryString("userid") = "" Then

        Response.Write("Unable to locate systems as Login ID is missing")

    End If
End Sub







What i am having trouble with is trying to get the DropDownList populated but what i have tried so far nothing happens. The code below is everything i have tried..



1. I tried creating a DDL on the stealth page server side with the code below




What i am having trouble with is trying to get the DropDownList populated but what i have tried so far nothing happens. The code below is everything i have tried..

1. I tried creating a DDL on the stealth page server side with the code below

Dim dl As New DropDownList
           Dim dt2 As New DataSet

           dt2 = GetUserName.ddlData(Request.QueryString("userid").ToString)

           dl.DataSource = dt2
           dl.DataValueField = "description"
           dl.DataTextField = "description"
           dl.DataBind()





2. I tried coding the DDL from the search page server side..



2. I tried coding the DDL from the search page server side..

If Request.QueryString("userid") <> "" Then

   '        Dim ddlResult As New DataSet
   '        Dim dt1 As DataTableReader

   '        ddlResult = GetUserName.ddlData(Request.QueryString("userid").ToString)
   '        dt1 = ddlResult.CreateDataReader

   '        sysDDL.DataSource = dt1
   '        sysDDL.DataValueField = "description"
   '        sysDDL.DataTextField = "description"
   '        sysDDL.DataBind()
   '        sysDDL.Items.Insert(0, New ListItem(String.Empty, String.Empty))
   '        sysDDL.SelectedIndex = 0

   '    End If





3. I even tried creating another page to create the information for the DDL on page load..





3. I even tried creating another page to create the information for the DDL on page load..

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

     If Request.QueryString("userid") <> "" Then

         Dim ddlResult As New DataSet
         Dim dt As DataTableReader

         ddlResult = GetUserName.ddlData(Request.QueryString("userid").ToString)
         dt = ddlResult.CreateDataReader

     End If

 End Sub





but i couldnt work out the correct function to write on the search page to call.



Again i apologize that there is a lot of code but i needed to make sure all the information is here.



I was given this info and code to try but this is very confusing for me as i dont know what to put where..



Call stealth query

Data object returns a string like option1**option2**option3



var arrSplit = data.split(\"**\");

$(\"#\").css(\"display\", \"block\");



$(\"#\").empty();

var ddl = $(\"#\");



ddl.append(\"<option value=’’></option>\");

for (i = 0;我< arrSplit.length - 1; i++) {

ddl.append(\"<option value=’\" + arrSplit[i] + \"’>\" + arrSplit[i] + \"</option>\");

}









Thank You



but i couldnt work out the correct function to write on the search page to call.

Again i apologize that there is a lot of code but i needed to make sure all the information is here.

I was given this info and code to try but this is very confusing for me as i dont know what to put where..

Call stealth query
Data object returns a string like "option1**option2**option3"

var arrSplit = data.split("**");
$("#").css("display", "block");

$("#").empty();
var ddl = $("#");

ddl.append("<option value=''></option>");
for (i = 0; i < arrSplit.length - 1; i++) {
ddl.append("<option value='" + arrSplit[i] + "'>" + arrSplit[i] + "</option>");
}




Thank You

推荐答案

(function () {


(\"#dEditdob\").datepicker({
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
yearRange: '-100y:c+nn',
maxDate: '-1d'
});
});
</script>



<div id=\"dUserSystems\" runat=\"server\" >
<u>Systems user has access to</u><br />
<div id=\"dUserData\"></div>
<br />

<div id=\"ddlSysData\" runat=\"server\" >
<u>Add new system to users account</u><br />
<asp:DropDownList ID=\"sysDDL\" runat=\"server\"/>
</div>
<br />
<input type=\"button\" id=\"butAdd\" value=\"Add\" runat=\"server\"/>&nbsp;
<input type=\"button\" onclick=\"butClose()\" value=\"Close\" />
</div>



<div id=\"dUserEdit\" runat=\"server\">
<table>
<tr>
<td>
Edit User Details
</td>
</tr>
<tr>
<td>
Login ID
</td>
<td>
<input id=\"dEditlogin\" type=\"text\" disabled=\"disabled\" />
</td>
</tr>
<tr>
<td>
Staff ID
</td>
<td>
<input id=\"dEditstaff\" type=\"text\" maxlength=\"20\" />
</td>
</tr>
<tr>
<td>
Surname
</td>
<td>
<input id=\"dEditsurname\" type=\"text\" maxlength=\"40\"/>
</td>
</tr>
<tr>
<td>
First Name
</td>
<td>
<input id=\"dEditfirstn\" type=\"text\" maxlength=\"30\"/>
</td>
</tr>
<tr>
<td>
Middlename
</td>
<< span class=\"code-leadattribute\">td
>
<input id=\"dEditmiddle\" type=\"text\" maxlength=\"40\"/>
</td>
</tr>
<tr>
<td>
Date of Birth
</td>
<td>
<input id=\"dEditdob\" type=\"text\" maxlength=\"20\" readonly=\"readonly\" />
</td>
</tr>
<tr>
<td>
Prof Number
</td>
<td>
<input id=\"dEditprof\" type=\"text\" maxlength=\"20\"/>
</td>
</tr>
<tr>
<td>
Job Title
</td>
<td>
<input id=\"dEditjob\" type=\"text\" maxlength=\"60\"/>
</td>
</tr>
<tr>
<td>
Department
</td>
<td>
<input id=\"dEditdept\" type=\"text\" maxlength=\"60\"/>
</td>
</tr>
<tr>
<td>
Site
</td>
<td>
<input id=\"dEditsite\" type=\"text\" maxlength=\"60\"/>
</td>
</tr>
</table>
<input type=\"button\" onclick=\"butUpdate()\" value=\"Update\" />
<input type=\"button\" onclick=\"butCancel()\" value=\"Close\" />
</div>



<div id=\"dUpdatemsg\" runat=\"server\">
<div id=\"dMsg\"></div>
<input type=\"button\" id=\"updateClose\" onclick=\"msgClose()\" value=\"Ok\" />
</div>





<%--
<div id=\"dialog\" title=\"Basic Dialog\" style=\"display: none;\">
<p id=\"alertmsg\">test msg</p>
</div>
--%>


<br />

<div id=\"userSearchForm\">

<div id=\"sHeader\">
<asp:Label ID=\"uHeader\" runat=\"server\" Text=\"User Search\"></asp:Label><br />
</div>

<div id=\"searchTest\">

<div id=\"userTitles\">

<div id=\"slogin\">
<label for=\"sLoginid\">Login ID</label>
</div>
<div id=\"sfName\">
<label for=\"sfirstName\">First Name</label>
</div>
<div id=\"slName\">
<label for=\"slastName\">Surname</label>
</div>
<div id=\"sEsrNumb\">
<label for=\"sESRNumber\">ESR Number</label>
</div>
<div id=\"sProfNumb\">
<label for=\"sprofNumber\">Prof No</label>
</div>

<
/div>

<div id=\"sInput\">

<div id=\"sLoginInput\">
<input id=\"sLoginid\" name=\"sUserId\" runat=\"server\" autopostback=\"True\" style=\"display: inline-block; width: 260px;\" type=\"text\" /><br />
</div>
<div id=\"sFnameInput\">
<input id=\"sfirstName\" name=\"sfirstName\" runat=\"server\" autopostback=\"True\" style=\"display: inline-block; width: 260px;\" type=\"text\" /><br />
</div>
<div id=\"slNameInput\">
<input id=\"slastName\" name=\"slastName\" runat=\"server\" autopostback=\"True\" style=\"display: inline-block; width: 260px;\" type=\"text\" /><br />
</div>
<div id=\"sEsrInput\">
<input id=\"sESRnumber\" name=\"sESRnumber\" runat=\"server\" autopostback=\"True\" style=\"display: inline-block; width: 260px;\" type=\"text\" /><br />
</div>
<div id=\"sProfInput\">
<input id=\"sprofNumber\" name=\"sprofNumber\" runat=\"server\" autopostback=\"True\" style=\"display: inline-block; width: 260px;\" type=\"text\" /><br />
</div>
</div>
</div>
</div>
<br />


<div id=\"sButtons\">
<asp:Button ID=\"buttonSearch\" class=\"showSystemsPop\" runat=\"server\" Text=\"Search\" Width=\"107px\" />&nbsp;&nbsp;

</div>


<br />
<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:Button ID=\"adNewUser\" runat=\"server\" Text=\"Add User\" Width=\"107px\" Visible=\"false\" />


<br />


<br />

<div id =\"content\">
<asp:PlaceHolder ID=\"placeResults\" runat=\"server\"></asp:PlaceHolder>
<asp:Label ID=\"noResultOutput\" runat=\"server\" Font-Bold=\"True\" Font-Names=\"Arial\" Font-Size=\"Larger\" ForeColor=\"#FF3300\" CssClass=\"noResult\"></asp:Label>
</div>








<script>



//Function used to grab users details when admin is looking to update details
function editUser(loginid, staffid, surname, firstname, middlename, dob, profnumb, jobtitle, department, site) {
("#dEditdob").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: '-100y:c+nn', maxDate: '-1d' }); }); </script> <div id="dUserSystems" runat="server" > <u>Systems user has access to</u><br /> <div id="dUserData"></div> <br /> <div id="ddlSysData" runat="server" > <u>Add new system to users account</u><br /> <asp:DropDownList ID="sysDDL" runat="server"/> </div> <br /> <input type="button" id="butAdd" value="Add" runat="server"/>&nbsp; <input type="button" onclick="butClose()" value="Close" /> </div> <div id="dUserEdit" runat="server"> <table> <tr> <td> Edit User Details </td> </tr> <tr> <td> Login ID </td> <td> <input id="dEditlogin" type="text" disabled="disabled" /> </td> </tr> <tr> <td> Staff ID </td> <td> <input id="dEditstaff" type="text" maxlength="20" /> </td> </tr> <tr> <td> Surname </td> <td> <input id="dEditsurname" type="text" maxlength="40"/> </td> </tr> <tr> <td> First Name </td> <td> <input id="dEditfirstn" type="text" maxlength="30"/> </td> </tr> <tr> <td> Middlename </td> <td> <input id="dEditmiddle" type="text" maxlength="40"/> </td> </tr> <tr> <td> Date of Birth </td> <td> <input id="dEditdob" type="text" maxlength="20" readonly="readonly" /> </td> </tr> <tr> <td> Prof Number </td> <td> <input id="dEditprof" type="text" maxlength="20"/> </td> </tr> <tr> <td> Job Title </td> <td> <input id="dEditjob" type="text" maxlength="60"/> </td> </tr> <tr> <td> Department </td> <td> <input id="dEditdept" type="text" maxlength="60"/> </td> </tr> <tr> <td> Site </td> <td> <input id="dEditsite" type="text" maxlength="60"/> </td> </tr> </table> <input type="button" onclick="butUpdate()" value="Update" /> <input type="button" onclick="butCancel()" value="Close" /> </div> <div id="dUpdatemsg" runat="server"> <div id="dMsg"></div> <input type="button" id="updateClose" onclick="msgClose()" value="Ok" /> </div> <%-- <div id="dialog" title="Basic Dialog" style="display: none;"> <p id="alertmsg">test msg</p> </div>--%> <br /> <div id="userSearchForm"> <div id="sHeader"> <asp:Label ID="uHeader" runat="server" Text="User Search"></asp:Label><br /> </div> <div id="searchTest"> <div id="userTitles"> <div id="slogin"> <label for="sLoginid">Login ID</label> </div> <div id="sfName"> <label for="sfirstName">First Name</label> </div> <div id="slName"> <label for="slastName">Surname</label> </div> <div id="sEsrNumb"> <label for="sESRNumber">ESR Number</label> </div> <div id="sProfNumb"> <label for="sprofNumber">Prof No</label> </div> </div> <div id="sInput"> <div id="sLoginInput"> <input id="sLoginid" name="sUserId" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br /> </div> <div id="sFnameInput"> <input id="sfirstName" name="sfirstName" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br /> </div> <div id="slNameInput"> <input id="slastName" name="slastName" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br /> </div> <div id="sEsrInput"> <input id="sESRnumber" name="sESRnumber" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br /> </div> <div id="sProfInput"> <input id="sprofNumber" name="sprofNumber" runat="server" autopostback="True" style="display: inline-block; width: 260px;" type="text" /><br /> </div> </div> </div> </div> <br /> <div id="sButtons"> <asp:Button ID="buttonSearch" class="showSystemsPop" runat="server" Text="Search" Width="107px" />&nbsp;&nbsp; </div> <br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="adNewUser" runat="server" Text="Add User" Width="107px" Visible="false" /> <br /> <br /> <div id ="content"> <asp:PlaceHolder ID="placeResults" runat="server"></asp:PlaceHolder> <asp:Label ID="noResultOutput" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="Larger" ForeColor="#FF3300" CssClass="noResult"></asp:Label> </div> <script> //Function used to grab users details when admin is looking to update details function editUser(loginid, staffid, surname, firstname, middlename, dob, profnumb, jobtitle, department, site) {


(\"#dEditlogin\").val(loginid.replace(/\#/g, \" \"));
("#dEditlogin").val(loginid.replace(/\#/g, " "));


这篇关于如何使用隐形调用填充vb.net下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆