Please Guys look at my Code,it is working when I click Button1 it lots all the controls that I want inside a repeator,But My problem is that I want the second dropdown inside a repeator to display the value depending/according on the first dropdown selection.How do I go about? Eg DropDown1 loads all the car name(toyota,audi,bmw) after selection,maybe (Audi)Dropdown2 load(A3,A4) Who do I go about inside the repeator Code Imports System.Net.Mail Partial Class cap Inherits System.Web.UI.Page Dim OSource As Businesslayer.Users = New Businesslayer.Users Dim rs As Data.DataSet Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ds As New Data.DataSet Dim obj As Businesslayer.ClientSite = New Businesslayer.ClientSite Dim NumberOfBoxes As Integer Dim WhichBox As Integer Dim rows() As Integer NumberOfBoxes = Integer.Parse(txtDay.Text) - 1 ReDim rows(NumberOfBoxes) For WhichBox = 0 To NumberOfBoxes rows(WhichBox) = WhichBox Next Repeater1.DataSource = rows Repeater1.DataBind() For WhichBox = 0 To NumberOfBoxes Dim cmbProjectName As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbProjectName"), DropDownList) ds = obj.GetProjectNameFromProjAdmin cmbProjectName.DataSource = ds cmbProjectName.DataBind() cmbProjectName.Items.Add(New ListItem("", "")) cmbProjectName.Items.Item(cmbProjectName.Items.Count - 1).Selected = True Dim cmbClientSite As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbClientSite"), DropDownList) ds = obj.GetClientIDFromProjAdmin cmbClientSite.DataSource = ds cmbClientSite.DataBind() cmbClientSite.Items.Add(New ListItem("", "")) cmbClientSite.Items.Item(cmbClientSite.Items.Count - 1).Selected = True Dim cmbProjectManager As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbProjectManager"), DropDownList) ds = obj.GetProjectManagers cmbProjectManager.DataSource = ds cmbProjectManager.DataBind() cmbProjectManager.Items.Add(New ListItem("", "")) cmbProjectManager.Items.Item(cmbProjectManager.Items.Count - 1).Selected = True Dim cmbCategory As DropDownList = CType(Repeater1.Items(WhichBox).Fin
Oga M
Posts
-
Dropdown inside a repeator control using vb -
ListBoxes to display information when clicking the buttonHi I have 3 listboxes on my webpage,The first one which is ListBox2,when that page loads it display all the project members,It does that. That second and third ones when the user clicks the button it should display all the selected members in second listbox (ListBox1) and their Email address in the third listBox (ListBox3). This is my Code for the button click ,when the page loads it display all the project members but,when I chick the button ,it only display the selected members in the second Listbox(ListBox1)and doesn't display their email address in the third ListBix(ListBox3) **I WANT IT TO DISPLAY ALSO THE EMAIL ADDRESS IN THE THIRD LISTBOX,PLEASE HELP ME Protected Sub bntAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bntAdd.Click If ListBox2.SelectedIndex >= 0 Then Dim i As Integer For i = 0 To ListBox2.Items.Count - 1 If ListBox2.Items(i).Selected Then If Not lasset.Contains(ListBox2.Items(i)) Then lasset.Add(ListBox2.Items(i)) End If End If Next i For i = 0 To lasset.Count - 1 If Not ListBox1.Items.Contains(CType(lasset(i), ListItem)) Then ListBox1.Items.Add(CType(lasset(i), ListItem)) End If ListBox2.Items.Remove(CType(lasset(i), ListItem)) Next i Else 'ListBox2.SelectedIndex >= 0 Then Dim UserAdmin_Id As Integer Dim ds As New Data.DataSet Dim objdata As Businesslayer.TimeSheet = New Businesslayer.TimeSheet ds = objdata.GetMemberEmail(UserAdmin_Id) Dim Email As Integer For Email = 0 To ListBox2.Items.Count - 1 If ListBox2.Items(Email).Selected Then If Not lasset.Contains(ListBox2.Items(Email)) Then lasset.Add(ListBox2.Items(Email)) End If End If Next Email For Email = 0 To lasset.Count - 1 If Not ListBox3.Items.Contains(CType(lasset(Email), ListItem)) Then ListBox3.Items.Add(CType(lasset(Email), ListItem)) End If ListBox1.Items.Remove(CType(lasset(Email), ListItem)) Next Email End If End Sub
-
button inside a gridview to display more detailed grid viewThis is the code for the first gridview,when the page open it should display the names of all the project members, Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack = False Then 'txtProjectManager.Text = Session("ProjectManager") Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Dim ds As New Data.DataSet ds = obj.GetProjectMembers1 GridView2.DataSource = ds GridView2.DataBind() End If End Sub This is the code foe the btn when I click the button inside the gridview it must show,the second gridview for each row Private Sub Button1_Click(ByVal o As Object, ByVal e As EventArgs) Dim Button1 As Button = DirectCast(o, Button) Dim grdRow As GridViewRow = DirectCast(Button1.Parent.Parent, GridViewRow) Dim strField1 As String = grdRow.Cells(0).Text Dim strField2 As String = grdRow.Cells(0).Text End Sub This is the code for the second grid view Protected Sub GridView2_SelectedIndexChanging(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView2.SelectedIndexChanged Dim gv As GridView = CType(sender, GridView) Dim ds As New Data.DataSet Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet ds = obj.GetTimeSheet(gv.SelectedValue.ToString()) obj = Nothing GridView1.DataSource = ds GridView1.DataBind() End Sub When I click the btn,it only postback,doesn’t display the second gridview,what might be the problem?
-
gridviewn + buttonFirst grid view displaying the names of all project members I have a button inside that grid view, when I chick it, it must show the more information of that person on the other grid view. How do I go about?
-
dropdown to display the information vb.net(ASP.NET)PLEASE HELP ME WITH THIS PROBLEMs 1.Dropdown to display the names,when I select the name inside the dropdown automatically display the email address of that person inside the txetbox next to the drop down. 2.When I douple click the name inside the dropdown,the name to be display inside the listbox,and the user must have an access to delete them.
-
Display the week number after selecting the Date from Date PickerHi guys Please help me,I have a Date picker inside my repeter control,After the user captured all the information that is inside the control of the repetor,when they save the information,it should also send an email to the selected manager,and display the week number of the first selected date.
-
thumbnail in asp.net (vb)thank you,that is what I have done,but I'm fornunetly it doesn't work cause I'm using web form not html page,I'm also using a master page in my application.
-
thumbnail in asp.net (vb)Hello Please help me,i have saved both(big and small)of my pictures in the folder in my application,I have puted the small ones,what I want to do is when the user click the small one,the big one should open. Please help me guys
-
please help me with this codeI have disabled my session statement,but it still giving me the same problem. And when I say select all it diplay all the information inside the table in the gridview on the nextpage oga m
-
please help me with this codeProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim GridView1 As New GridView Dim Login As Businesslayer.Users = New Businesslayer.Users 'Check for empty date fields and give usera message Dim str As String = " SELECT Rejected, Total_Hours, Category, Bill, Description, Hours, Date, Occupation, Project_Manager, Project_Member, Client_Site, Project_Name, Id_Number FROM Timesheet " & _ "WHERE (Date >= CONVERT(DATETIME, " & txtSDate.Text & " ))" & _ " AND (Date <= CONVERT(DATETIME," & txtEDate.Text & ")) ORDER BY Date " Dim bLayer As New Businesslayer.GlobalFunctions Dim reader As Data.SqlClient.SqlDataReader = bLayer.returnRecords(str) 'Test for record count > 0, give message to user for 0 records. If reader.HasRows Then Session("Client_site") = reader("ClientSite") Session("Project_Name") = reader("ProjectName") Session("Date1") = reader("SDate") Session("Date1") = reader("EDate") Response.Redirect("ViewTimesheet.aspx") Response.End() Else UserMsgBox("Please select the Start Date and End Date") End If End Sub ************* I want this button to display the gridview on the other page after the user select the starting date and Ending on to different calenders(according to the selected dates). oga m
-
gridview + vbfrom txtSdate and txtEdate oga
-
gridview + vbplease help me with the sql statement to display the information on the gridview according to the selected dates(stating date and ending date)when you click generate info butto oga
-
gridviewusing gridview to display information in the tablefrom selected starting date and ending date please help me with the code for this oga m
-
GridView ControlHi guy I'm new and still learning asp.net(vb).I have 3 GridView in one form ,when page load,only the first GriView to be visible,It has the commandfield(select)when the user clicks the command fiels,make the first one invisible and second one visible(on the position of the first one)The second GridView have 2 commandfiels view(to allow the user to go to the Third GridView) and back(to allow the user to go to the first GridView). When clicking the view on the second GriView make the second one invisible and third one visible(on the position of the first one). And Allow only the CheckBox of the third GridView to check and uncheck .Lastly Save Button to to save the information in table. **** Pease guys this is acutellt what I what to do ***Please help me with the code for this oga m
-
It's urget please help me with this codePlease help me with this code ************* Protected Sub ButtonSubMana_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSubMana.Click Dim ds1 As New Data.DataSet Dim obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Dim NumberOfBoxes As Integer Dim WhichBox As Integer NumberOfBoxes = Integer.Parse(WhichBox) Dim rows(NumberOfBoxes) As Integer Dim Repeater1 As Repeater For WhichBox = 0 To NumberOfBoxes Dim txtDate As TextBox = CType(Repeater1.Items(WhichBox).FindControl("txtDate"), TextBox) Dim cmbProjectName As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbProjectName"), DropDownList) Dim cmbClientSite As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbClientSite"), DropDownList) Dim cmbProjectManager As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbProjectManager"), DropDownList) Dim cmbProjectMember As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbProjectMember"), DropDownList) Dim cmbCategory As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbCategory"), DropDownList) Dim cmbOccupation As DropDownList = CType(Repeater1.Items(WhichBox).FindControl("cmbOccupation"), DropDownList) Dim txtHours As TextBox = CType(Repeater1.Items(WhichBox).FindControl("txtHours"), TextBox) Dim CheckBox1 As CheckBox = CType(Repeater1.Items(WhichBox).FindControl("CheckBox1"), CheckBox) Dim txtDescription As TextBox = CType(Repeater1.Items(WhichBox).FindControl("txtDescription"), TextBox) obj.addTimesheet(txtIDNumber.Text, cmbProjectName.SelectedItem.Text, cmbClientSite.SelectedItem.Text, cmbProjectManager.SelectedItem.Text, cmbProjectMember.SelectedItem.Text, cmbOccupation.SelectedItem.Text, txtDate.Text, Double.Parse(txtHours.Text), txtDescription.Text, CheckBox1.Checked, cmbCategory.SelectedItem.Text) Next Dim Manager_Id(0) As Integer Dim Timesheet(0) As String Dim i As Integer For i = Manager_Id To Timesheet Manager_Id(i) = Manager_Id(i - 1) + Manager_Id(i - Timesheet) Next Me.DataSource = Manager_Id Me.Repeater1.DataBind() Dim from As MailAddress = New MailAddress("boipelo@ecominstitute.com", "Boipelo Mothusi") Dim recieve As MailAddress = New M
-
GridView ControlI am a beggineer in asp.net programming(vb),please help me with the gridview.I have a GridView Control in my form,and have a commandfield(select as a button).please gelp me with the step by step titorial.How do I bound my GridBView ,When the user click the button to display more information on the second dridView,when the user clicks the button on the particular row (make the second gridview visible)display the informaton of the person. Thank you in advance oga m
-
GridView ControlHello I'm a begginer in programming[asp.net(vb)] Please tell me how do I access CommandField inside of a GridView........ I have a button inside my GridView1.I want it to display More Infomation on the other GridView2,about the member selected oga m
-
GridViewHello I'm a begginer in programming[asp.net(vb)] Please tell me how do I access CommandField inside of a GridView........ I have a button inside my GridView1.I want it to display More Infomation on the other GridView2,about the member selected oga m
-
please help me which this codeCan you please help me with my error ************ This is the Error ************ Error 2 Argument not specified for parameter 'ConPassword' of 'Public Sub addNewAdmin(Email As String, IDNumber As String, Title As String, Surname As String, Name As String, Occupation As String, Cell As String, Telephone As String, Password As String, ConPassword As String)'. C:\FinalTimeSheet\UserAdmin.aspx.vb 9 C:\FinalTimeSheet\ ********* This is my code *********** Public Sub addNewAdmin(ByVal Email As String, ByVal IDNumber As String, ByVal Title As String, ByVal Surname As String, ByVal Name As String, ByVal Occupation As String, ByVal Cell As String, ByVal Telephone As String, ByVal Password As String, ByVal ConPassword As String) Dim Sql As String Dim obj As Datalayer.Database = New Datalayer.Database Sql = "insert into UserAdministration (E_mail,Id_Number,Title,Surname,Name,Occupation,Mobile_Number,Telephone,Password,Confirm_Password)" & _ " Values('" & Email & "','" & IDNumber & "','" & Title & "','" & Surname & "','" & Name & "', '" & Occupation & "', '" & Cell & "','" & Telephone & "','" & Password & "','" & ConPassword & "')" obj.Execute(Sql) End Sub ************* Code for Button Click ************ Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click Dim ds As New Data.DataSet Dim Obj As Businesslayer.TimeSheet = New Businesslayer.TimeSheet Obj.addNewAdmin(txtEmail.Text, txtIdNumber.Text, txtTitle.Text, txtSurname.Text, txtOccupation.Text, txtCell.Text, txtTelephone.Text, txtPassword.Text, txtConPassword.Text) If txtPassword.Text <> txtConPassword.Text Then MsgBox("Passwords do not match") txtPassword.Focus() Exit Sub Else SaveData() End If End Sub ************* oga m
-
please help me with this errorplease help me with this code,I really don't understand what might be the problem oga m