0

In my ASP.Net application, there's a UserControl called EmployeesUserControl which is shown through a JQuery modal dialog.

Before showing the Employees, I've got to pass a filter criteria which is the entity that the employee is belong to. My question is that how can I pass the value from javascript to the UserControl?


What I tried so far is that I created a HiddenControl called SelectedEntityHiddenControl and I set it a value before showing the popup, hence, when the popup is shown and the Page_Load event handler of the UserControl is called, then I read the value of the hidden control and filter by it. But I don't think it's a good implementation what I've already done.

Any suggestion!

2
  • 2
    aspxtutorial.com/post/2011/01/02/… Commented Jul 30, 2011 at 19:55
  • I fully agree with DSW - will be better pass filter params and get result by one ajax-call. Mainstream is AJAX!!! In these cases I often use AjaxPro-library - its really simple. Commented Jul 30, 2011 at 20:38

1 Answer 1

1

I think it's a good solution. I'm also using HiddenFields to pass values from JS to the ASP.NET Engine and back.

You've to ensure that your values are passed to the asp.net engine at the correct moment within the lifecycle.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.