search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Any way you can pass a model in BackendURL

Asked by B
8 years ago.

Hello there

Is there any way we can pass a model in "BackendUrl = Url.Action("Backend", "Controller", "Test Model" ),"

Thanks

Answer posted by Dan Letecky [DayPilot]
8 years ago.

The backend URL is just a URL string and it doesn't allow passing anything else.

You can pass custom parameters as an ID, query string or in a cookie.

Example for custom query string:

@Url.Action("Backend", "Controller", new { user = "John", type = "2" })

You can read the query string anywhere in the backend class using Controller.Request.QueryString:

public class Dps: DayPilotScheduler {
  protected override void OnInit(InitArgs ea)
  {
    string name = Controller.Request.QueryString["name"];
    // ...
  }
}
Comment posted by B
8 years ago.

Thanks Dan

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.