Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 corrospoding ref into parameter and post it

Author  Topic 

jtwork
Yak Posting Veteran

82 Posts

Posted - 2009-01-04 : 07:11:33
I have the following code and have a sqldatasource to execute a stored proc and send the ref number and drop down value as a parameter. The drop down posts the value but im not sure how to get the corrospoding ref number into a parameter to pass in my stored procedure?

Anyone able to advise on how best to do this possibly with an example?




<asp:GridView ID="Gridview4" runat="server" AutoGenerateColumns="False" pagesize="1"
EmptyDataText="No Records found!">
<Columns>
<asp:TemplateField HeaderText="Ref Number">
<ItemTemplate><%#Eval("Ref_Num")%></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<aspropDownList ID="DropDownList1" runat="server" AutoPostBack="true">
<asp:ListItem Value="-1" Selected="True">choose one of the following ...</asp:ListItem>
<asp:ListItem Value="1">value1</asp:ListItem>
<asp:ListItem Value="2">value2</asp:ListItem>
<asp:ListItem Value="3">value3</asp:ListItem>
<asp:ListItem Value="4">value4</asp:ListItem>
<asp:ListItem Value="4">value5</asp:ListItem>
<asp:ListItem Value="4">value6</asp:ListItem>
<asp:ListItem Value="4">value7</asp:ListItem>
</aspropDownList>
</ItemTemplate>
</asp:TemplateField>


</Columns>
</asp:GridView>
   

- Advertisement -