<%#ViewData["id"] %>
<h2>MarkerDetail</h2>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$.ajax({
url:"/Marker/MarkerDetailPartial",
data:"",
success:function(result){
$开发者_Go百科("#ReplyDetails").html(result);
},
error:function(result){
}
});
});
</script>
<div id="ReplyDetails">
</div>
& i want to send Id only By this Ajax
What you need to do is simply write out the value from the viewdata in the appropriate place. Something like this:
....
url:'/Marker/MarkerDetailPartial/<%=ViewData["id"]%>',
....
Or like this:
....
data:{'id':<%=ViewData["id"]%>},
....
Remember that all server side code is already executed and rendered when your javascript executes.
精彩评论