Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6017731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:10:16+00:00 2026-05-23T03:10:16+00:00

So I have a Web Forms asp control: <asp:DropDownList runat=server ID=ExistingTemplate ClientIDMode=Static /> On

  • 0

So I have a Web Forms asp control:

<asp:DropDownList runat="server" ID="ExistingTemplate" ClientIDMode="Static" />

On the backend code, it gets populated through this:

public override void DataBind()
    {
        base.DataBind();

        var selectList = Chatham.Web.Models.Indications.DropDownData.AllEditableTemplates();
        ExistingTemplate.DataSource = selectList.Items;
        ExistingTemplate.DataTextField = selectList.DataTextField;
        ExistingTemplate.DataValueField = selectList.DataValueField;
        ExistingTemplate.DataBind();


        SetTabVisibility();
    }

Now, I want to refactor the AllEditableTemplates method to take a parameter. This parameter is only accessible through the client side Javascript code, on the master page front end.

How can I pass a parameter to this method that I get from Javascript on the page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:10:17+00:00Added an answer on May 23, 2026 at 3:10 am

    Expose it as a web method and have javascript call it, instead of it trying to get the value from javascript.
    http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx

    Using a hidden field has a problem – normally, data bind is called right away somewhere, which means the initial request to the web server didn’t have the form field set yet and it will be empty. You would need a second request in order for it to populate so that your form request had it. Calling the web method from the client instead solves this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a server control on a single web.forms page. I have to
I have a ASP.NET Web Forms application and I'm using some dynamic controls in
I have a repeater control on an ASP.NET 2.0 web form. As I understanding
I have a checkbox list control on my asp.net web form that I am
I have a usercontrol in an asp web forms application that I am working
I have a asp.net web forms app that uses System.Web.Caching.Cache to cache xml data
Using web forms I know that you can only have one ASP.NET form on
I have a simple ASP.NET 3.5 SP1 Web Forms app... I've added the System.Web.Routing
I have authentication mode set to forms in my asp.net web.config but am still
I have a website that uses basic ASP.Net forms authentication. In the web.config file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.