|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have such code: Code:
<asp:SqlDataSource ID="CellSqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:dbConnectionString %>" SelectCommand="SELECT * FROM [Map] WHERE (([X] = '50') AND ([Y] ='50'))"> </asp:SqlDataSource> And instead of the '50' I want to put there a javascript variable ? any idea how to do this ? thanks ------------ Im sorry , in javascript it s not possible, but how to put there the variables from asp ? Code:
<asp:SqlDataSource ID="CellSqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:dbConnectionString %>"
SelectCommand="SELECT * FROM [Map] WHERE (([X] = '<%=lairX %>') AND ([Y] ='<%=lairY %>'))">
</asp:SqlDataSource>
Last edited by libor : July 2nd, 2009 at 11:58 AM. |
|
#2
|
|||
|
|||
|
you can try using below code in your javascript
aspele="<% do until rs1.EOF response.write("<option value=") response.write(rs1.fields("part_number")) response.write(">") response.write(rs1.fields("part_number")) response.write("</option>") rs1.MoveNext loop %>"; |
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Adding javascript variable into a SQL query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|