I have to pass a hide int value whenever i change the value of the dropdownlist in asp.net. How to do?
-
I have to fill a dropdownlist with two value as (id, value) in asp.net application. That value only fill with dropdownlist. that id should be hide. when i click the value that id has to passed as internally. how to do this?
-
Answer:
<% ' 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 %> <table border="1"> <thead> <% ' 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 "<th>" Response.Write rstExcel.Fields.Item(I).Name Response.Write "</th>" & vbCrLf Next 'I %> </thead> <% rstExcel.MoveFirst ' Loop through the data rows showing data in an HTML table. Do While Not rstExcel.EOF Response.Write "<tr>" & vbCrLf For I = 0 To iCols - 1 Response.Write "<td>" Response.Write rstExcel.Fields.Item(I).Value Response.Write "</td>" & vbCrLf Next 'I Response.Write "</tr>" & vbCrLf rstExcel.MoveNext Loop %> </table> <% rstExcel.Close Set rstExcel = Nothing cnnExcel.Close Set cnnExcel = Nothing %>
jeyagana... at Yahoo! Answers Visit the source
Related Q & A:
- How can I allow user to create posts in website using ASP.NET?Best solution by Programmers
- How can I change a value in an array?Best solution by Stack Overflow
- I'm going on a disney cruise, what should I bring?Best solution by Yahoo! Answers
- What is a post car ? I see that on a muscle car ad and I just don't get it?Best solution by Yahoo! Answers
- Whenever I get a runny nose, I bleed from my nose. How can I stop this?Best solution by healthtap.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.