asp.net mvc - How to get the ID from URL? -


मैं asp.net MVC का उपयोग कर रहा हूँ।

मेरे पास {url} / 2

तो दृश्य पृष्ठ पर मैं इस URL से आईडी कैसे प्राप्त करूं?

मैं कुछ पन्ने पर पुनर्निर्देशित करने के लिए एक लिंक डालूंगा आईडी से ऊपर भेजने के साथ

संपादित करें जैसे

  & lt;% = Html.ActionLink ("नाम", "एक्शन", "नियंत्रक" , नया {आईडी =?})% & Gt;  

आप इसे रूटडेटा ऑब्जेक्ट से प्राप्त कर सकते हैं

  & Lt;% = Html.ViewContext.RouteData.Values ​​["id"]। ToString ()% & gt;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -