Jump to content
Xtreme .Net Talk

salmani

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by salmani

  1. I have bind a list to logins to the dropdownlist control. And Thanks God it worked fine. Suppose database structure is like ******************************** ID NAME 1 Salman 2 Richards 3 Marry ********************************** But my problem is i want to pass the ID to the next page. When the users click any login for e.g salman, the page should submit and id(for e.g 1) should be passed to next page. I don't have any idea... How it can be done??? Will any one help??? Regards Salman --------------------------------------------------------------------------------- <%@ Import Namespace="System.Data.SqlClient" %> <%@ Page Language="vb"%> <HTML> <HEAD> <title>Dropdown Binding</title> <script runat="server"> Sub Page_load 'if not IsPostBack then Dim conPubs as SqlConnection Dim cmdSelect as SqlCommand Dim dtrAuthors as SqlDataReader conPubs = New SqlConnection("Server=WIN2K3\OMER; UID=sa; PWD=sa; database=personal") conPubs.Open() cmdSelect = New SqlCommand("Select name from login", conPubs) dtrAuthors=cmdSelect.ExecuteReader() dropAuthors.DataSource=dtrAuthors dropAuthors.DataTextField="name" dropAuthors.DataBind() dtrAuthors.Close() conPubs.Close() 'End if End Sub Sub Press(Sender as object, E as EventArgs) Name.text=dropAuthors.selectedItem.Text end sub </script> </HEAD> <body MS_POSITIONING="GridLayout"> <TABLE height="206" cellSpacing="0" cellPadding="0" width="101" border="0" ms_2d_layout="TRUE"> <TR vAlign="top"> <TD width="101" height="206"> <form runat="server"> <TABLE height="84" cellSpacing="0" cellPadding="0" width="194" border="0" ms_2d_layout="TRUE"> <TR vAlign="top"> <TD colSpan="3" height="2"></TD> <TD colSpan="2" rowSpan="2"> <asp:Button Text="Pick Authors" onclick="Press" Runat="server" id="Button1"></asp:Button></TD> </TR> <TD colSpan="3"> <asp:DropDownList ID="dropAuthors" Runat="server"></asp:DropDownList></TD> </TR> <TR vAlign="top"> <TD colSpan="2" height="20"></TD> <TD colSpan="2"> <asp:Label id="Label1" runat="server">You have selected</asp:Label></TD> <TD> <asp:Label ID="Name" runat="server"></asp:Label></TD> </TR> </TABLE> </form> </body> </HTML> -----------------------------------------------------------------------------------
  2. I am working on checkbox. I have my first page as checkbox.aspx. In this page, i have three fields in my checkboxes as nike,addidas and slazenger. But when i pass value to my next page(checkbox-result.aspx) through server.transfer method,nothing get displayed.None of the values are passing from first page to second page. I am very worried. CAn any one help. Regards SAlman ////////////// Checkbox.aspx //////////////////// <script language="vb" runat="server"> Sub Pressme(Sender as Object, E as EventArgs) server.transfer("Checkbox-result.aspx") End sub </script> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:CheckBoxList ID="checking" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"> <asp:ListItem Text="Nike" Value="Nike"></asp:ListItem> <asp:ListItem Text="Addidas" Value="Addidas" Selected="True"></asp:ListItem> <asp:ListItem Text="Slazenger" Value="Slazenger"></asp:ListItem> </asp:CheckBoxList> <asp:Button id="Button1" nclick="Pressme" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 112px" runat="server" Text="Get Result"></asp:Button> --------------------------------- ///////////checkbox-result.aspx/////////////// <%=Request.form("checking")%>
  3. Ok.. I will use repeater, data list or data grid control and let u know the results...
  4. But i want to display it in some table format rather than dropdown list control.. So for this, what should i do
  5. I am using select statement for displaying all of the users in the Categories table of Northwind Database. But in return, nothing is displaying on the page. CAn any one help Regards Salman Iqbal --------------- Select Statement for Northwind Database -------------- <%@ Page Language="vb"%> <%@ Import Namespace="System.Data.SqlClient" %> <HTML> <HEAD> <title>Dropdown Binding</title> <script runat="server"> Sub Page_load Dim conPubs as SqlConnection Dim cmdSelect as SqlCommand Dim dtrAuthors as SqlDataReader conPubs = New SqlConnection("Server=WIN2K3\OMER; UID=sa; PWD=sa; database=Northwind") conPubs.Open() cmdSelect = New SqlCommand("Select name from categories", conPubs) dtrAuthors=cmdSelect.ExecuteReader() End Sub </script> </HEAD> <body MS_POSITIONING="GridLayout"> <form runat="server" ID="Form1"> </form> </body> </HTML> **********************************
  6. I am working on checkbox. I have my first page as checkbox.aspx. In this page, i have three fields in my checkboxes as nike,addidas and slazenger. But when i pass value to my next page(checkbox-result.aspx) through server.transfer method,nothing get displayed.None of the values are passing from first page to second page. I am very worried. CAn any one help. Regards SAlman ////////////// Checkbox.aspx //////////////////// <script language="vb" runat="server"> Sub Pressme(Sender as Object, E as EventArgs) server.transfer("Checkbox-result.aspx") End sub </script> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <asp:CheckBoxList ID="checking" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"> <asp:ListItem Text="Nike" Value="Nike"></asp:ListItem> <asp:ListItem Text="Addidas" Value="Addidas" Selected="True"></asp:ListItem> <asp:ListItem Text="Slazenger" Value="Slazenger"></asp:ListItem> </asp:CheckBoxList> <asp:Button id="Button1" nclick="Pressme" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 112px" runat="server" Text="Get Result"></asp:Button> --------------------------------- ///////////checkbox-result.aspx/////////////// <%=Request.form("checking")%>
×
×
  • Create New...