问题描述:

 <strong>

<asp:Repeater ID="rptordercount" runat="server" DataSourceID="OrdersCount">

<ItemTemplate>

<%# Eval("TotalCount")%>

</ItemTemplate>

</asp:Repeater>

order</strong> placed in</p>

<select id="idGetOrderPlaced" onchange="funcGetOrderPlaced()">

<option value="1">past 1 months</option>

<option value="3">past 3 months</option>

<option selected="selected" value="6">past 6 months</option>

<option value="12">past 12 months</option>

</select>

Here is my sql datasource

 <asp:SqlDataSource ID="OrdersCount" runat="server" SelectCommand="exec spGetCountOrders @SessionID,@MonthCount"

ConnectionString="<%$ ConnectionStrings:dbWRConnectionString %>" ProviderName="<%$ ConnectionStrings:dbWRConnectionString.ProviderName %>">

<SelectParameters>

<asp:SessionParameter Name="SessionID" Type="String" SessionField="SID" />

<asp:ControlParameter Name="MonthCount" Type="String" ControlID="monthhidden" />

<%--<asp:QueryStringParameter Name="MonthCount" Type="String" QueryStringField="MC" />--%>

</SelectParameters>

</asp:SqlDataSource>

Jquery method like

 function funcGetOrderPlaced() {

// rptordercountdiv

debugger;

var DataID = $("#idGetOrderPlaced").val();

$("[id*='monthhidden']").val(DataID);

$("#rptordercountdiv").html(DataID);

// $("#rptordercount").val();

// var url1 = '/MyAccount/ShowOrders.aspx/Method';

var dd = '{count:' + $("#idGetOrderPlaced").val() + '}';

$('#rptordercountdiv').val(dd);

var url = '/MyAccount/ShowOrders.aspx?MC=' + DataID;

debugger;

var dataNew = null;

$.get(url, function (data) {

debugger;

$('#divAllOrderHistory').html("");

$('#divAllOrderHistory').append(data);

dataNew = data;

}, "html");

Now here DataID get Html Select control value...This value pass to

and i write proc like exec "spgetcountorders" to pass this pass value..

How can i pass this?please help me..

网友答案:

Can you access the hidden value in the Pre-Render for your SQLDataSource?

<asp:HiddenField ID="HiddenID" ClientIDMode="Static"
OnDataBinding="HiddenField_DataBinding"
OnPreRender="HiddenField_PreRender" value='<%# Bind("someValue") %>'
runat="server" />

protected void HiddenField_PreRender(object sender, EventArgs e)
{
//HiddenID.Value
}
相关阅读:
Top