mvc in view And controller When passing parameters between , have access to url To pass , But in url You need to add “id=123” It's something like this .

For example, the code :

 window.location.href = geturl('/Poll/DisplayPoll?threadId=' + data.threadId);

And then in controller Function using the following code to accept :

 public ActionResult Whatever(int threadId)

If you do not add “id=123”, You're going to report a mistake , Because it's impossible to parse url Where are the parameters in the address .

mvc in view And controll When passing parameters between , have access to url More related articles for delivery

  1. ASP.NET MVC in View The design of the

    1. Preface I feel like I haven't been in touch for a long time View 了 , I have nothing to do on weekends , Flip through the books on your desk to review ASP.NET MVC in View Related content of . 2. View summary View Through the application in Action Back in ...

  2. Test current C The stack frame growth direction of the environment and the stack pressing order when passing parameters

    Previous link : Last time because of a very common printf-bug( It is mentioned below ) It caused me to think about the stack , And wrote a little summary . This time, we'll try to understand different things C Environment for practice , Check some properties of its transfer parameters . This is the check written today C A program of environment . can ...

  3. delphi Some grammar knowledge of And parameter passing , Passing parameters by reference , Passing parameters by value

    //delphi in exit,abort,break,continue The difference between exit: Exit function body abort: Exception encountered , Be quiet , No display, no prompt break: Exit the current loop body , Include for ,whi ...

  4. 【ASP.NET MVC】View And Controller Transfer data between

    1   summary This article mainly from the operation of a brief analysis Controller<=>View They pass values to each other , About passing values between pages , If you are interested , Please refer to my other article ASP.NET There are several ways to transfer values between pages  . Co ...

  5. 【MVC】View And Control Data transfer between

    1. Controller towards View To transfer data Use ViewData To transfer data [ Weak type , Dictionary type ViewDataDictionary] ViewData[“Message_ViewData”] = “ He ...

  6. About MVC in View Use custom methods

    Today I learned that in MVC Of View Using custom methods in , It's simple , Let's share . 1. First, create a folder under the project , It is used to save the custom method we wrote . 2. Add a new class in the new folder , Name whatever you want ( It's better to associate with custom methods ...

  7. ASP.NET MVC The default Model Binder binding Action Parameter is List、Dictionary And so on

    In practice ASP.NET mvc Project under development , Sometimes you will encounter a parameter that is List.Dictionary And so on , By default ASP.NET MVC How the framework binds for us ASP.NET MVC Of Actio ...

  8. Asp.net mvc in View Presentation ( Two )

    [toc] The previous section introduced Asp.net mvc Middle Division ViewResult All of the outside ActionResult, This section introduces ViewResult. ViewResultBase ViewResul ...

  9. Paging technology framework (Pager-taglib) Study three (pager-taglib Chinese garbled problem when passing parameters in )

    One . Problem description problem : Use <pg:param name="key" /> When the tag passes Chinese parameters , There will be a mess . reason : Because it uses... By default gb2312 To encode the added parameters , If you ...

Random recommendation

  1. Computer network learning notes -- The design of network layer IP Address and subnet

    IPv4 Address : We know that at the network level (TCP/IP The Internet layer of the architecture ), One of the most important agreements is IP agreement , It's in the middle of IPv4 and IPv6 The transition period of , But for now ,IPv4 Still mainstream , So the main point is Ipv4. IP Address ...

  2. cinnamon The desktop is installed in another directory

    cinnamon The desk is pretty good , However, it can only be installed in /usr Under the table of contents There are a lot of scripts that are dead /usr Catalog The following modules need to be patched at compile time : 1.cinnamon in , You need to perform sed -i 's|usr/share|u ...

  3. HTC A510C Telecom mobile phone brushing process

    HTC A510C Telecom mobile phone brushing process record Writed by Peter Hu(2014.6.7) ON WIN7_64 The steps needed to brush the machine : 1)  take S-ON Encryption protected , Change to S-OFF Pattern , In this way, we can ...

  4. stay Android Discussion on the compatibility of open source class library in

    1. stay Android4.0 Environment actionbarsherlock.slidingmenu Class library , Can you be in 4.0 The following version uses I believe many people are like me , I thought it was in the lower version ( Such as Android2.1 or 2.3 ...

  5. timing 5 Seconds later, it resides in the element ID by content Content of element

    If I can only refresh a part of a specific page , It's going to be big , for example : The traffic lights on the dashboard show the status of the system . It's very easy to use jQuery JavaScript library , Refresh only part of the page . Once we're included in our page jQuer ...

  6. iOS Submit AppStore The reason for rejection

    1. Terms and conditions( Laws and provisions ) 1.1 As a developer of applications for the App Store you are bound by ...

  7. python &lt;type &#39;exceptions.UnicodeDecodeError&#39;&gt;: &#39;ascii&#39; codec can&#39;t decode byte 0xe6 in position 0: ordinal not in range(128) solve

    import sysimport osimport stringreload(sys) sys.setdefaultencoding("utf8")

  8. 【HDOJ】2103 Family planning

    The title is very interesting . Although it's not very difficult . #include <stdio.h> int main() { unsigned int m, n, case_n; unsigned ; scanf(&qu ...

  9. IIS Configuration problem solving

    Unrecognized property “targetFramework”. Note that property names are case sensitive . Configuration error explain :  An error occurred while processing the configuration file required to service the request . Please check the specific error details below and modify the configuration file as appropriate . The analyzer is wrong ...

  10. 20155332 2016-2017-2 《Java Programming 》 The first 5 Weekly learning summary

    Student number 2016-2017-2 <Java Programming > The first X Weekly learning summary Summary of the learning content of the textbook 1.Java All the abnormal classes in Throwable class .Throwable There are two main categories , One is Er ...