Skip to content

Ozar.net Developer Blog

Programming in PHP, C, C#, ASP.NET, Java, Objective-C, SQL also for MS SQL Server, Oracle & MySQL Development

Menu
  • Home
  • About
  • Tutorials
  • Contact
  • Privacy
Menu

How to pass a hide int value whenever i change the value of the dropdownlist in asp.net. How to do?

Posted on April 20, 2010April 21, 2010 by OD

In order to fill a dropdownlist with two value as (id, value) in an Asp.net application. When populating the dropdownlist, the id should be hidden. when an item is selected, that id has to be passed as internally. How can this be done?

Powered by Y! Answers

1 thought on “How to pass a hide int value whenever i change the value of the dropdownlist in asp.net. How to do?”

  1. Lobes says:
    April 21, 2010 at 12:02 AM

    <% ' Selected constants from adovbs.inc Const adOpenStatic = 3 Const adLockPessimistic = 2 Dim cnnExcel Dim rstExcel Dim I Dim iCols ' This is all standard ADO except for the connection string. ' You can also use a DSN instead, but so it'll run out of the ' box on your machine I'm using the string instead. Set cnnExcel = Server.CreateObject("ADODB.Connection") cnnExcel.Open "DBQ=" & Server.MapPath("xl_data.xls") & ";" & _ "DRIVER={Microsoft Excel Driver (*.xls)};" ' Same as any other data source. ' FYI: TestData is my named range in the Excel file Set rstExcel = Server.CreateObject("ADODB.Recordset") rstExcel.Open "SELECT * FROM TestData;", cnnExcel, _ adOpenStatic, adLockPessimistic ' Get a count of the fields and subtract one since we start ' counting from 0. iCols = rstExcel.Fields.Count %>

    <% ' Show the names that are contained in the first row ' of the named range. Make sure you include them in ' your range when you create it. For I = 0 To iCols - 1 Response.Write "

    ” & vbCrLf
    Next ‘I
    %>

    <% rstExcel.MoveFirst ' Loop through the data rows showing data in an HTML table. Do While Not rstExcel.EOF Response.Write "

    ” & vbCrLf
    For I = 0 To iCols – 1
    Response.Write “

    ” & vbCrLf
    Next ‘I
    Response.Write “

    ” & vbCrLf

    rstExcel.MoveNext
    Loop
    %>

    ”
    Response.Write rstExcel.Fields.Item(I).Name
    Response.Write “
    ”
    Response.Write rstExcel.Fields.Item(I).Value
    Response.Write “

    <% rstExcel.Close Set rstExcel = Nothing cnnExcel.Close Set cnnExcel = Nothing %>

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • NSTableView with Core Data Tutorial using NSFetchedResultsController
  • CodeIgniter Wizard – a new PHP CRUD Code Generator for macOS
  • Installing Oracle Database 10g Express Edition and Changing the Default HTTP Port
  • Xcode Tutorial 2 – Putting iAd into your App (The Apple Approved Way)
  • Cocoa Programming: A Quick-Start Guide for Developers

Blogroll

  • All Systems GO
  • GOZmosis
  • Maclord's Blog
  • Ozar.net

Tags

.NET 2008 application ASP.NET basic Beginning best books business Business Objects C# Database Databases Development Edition Guide iPhone Java Java EE learn Learning Microsoft MS SQL Server MySQL Objective-C Programming objects Oracle Part PHP PL/SQL Professional Programming Server Software SQL T-SQL TSQL Tutorial Tutorials Using Video Visual Visual Basic .NET Web Programming Tutorials XCode
© 2026 Ozar.net Developer Blog | Powered by Minimalist Blog WordPress Theme

Powered by
►
Necessary cookies enable essential site features like secure log-ins and consent preference adjustments. They do not store personal data.
None
►
Functional cookies support features like content sharing on social media, collecting feedback, and enabling third-party tools.
None
►
Analytical cookies track visitor interactions, providing insights on metrics like visitor count, bounce rate, and traffic sources.
None
►
Advertisement cookies deliver personalized ads based on your previous visits and analyze the effectiveness of ad campaigns.
None
►
Unclassified cookies are cookies that we are in the process of classifying, together with the providers of individual cookies.
None
Powered by