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 1081955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:14:09+00:00 2026-05-16T22:14:09+00:00

I’m trying to fix a problem with some code (not written by me) lnkbtnPageNumber.ID

  • 0

I’m trying to fix a problem with some code (not written by me)

                    lnkbtnPageNumber.ID = "PageNumberCustomerRef" + intPageNumber.ToString();
                    lnkbtnPageNumber.Command += new CommandEventHandler(lnkbtnPageNumber_Command);
                    lnkbtnPageNumber.CommandName = "DepotRef";
                    lnkbtnPageNumber.CommandArgument = intPageNumber.ToString();
                    lnkbtnPageNumber.Text = intPageNumber.ToString().PadLeft(3, '0');
                    lnkbtnPageNumber.Attributes.Add("style", "margin: 2px;");
                    pDepotRefPages.Controls.Add(lnkbtnPageNumber);

This code creates a link button, however when I click on the button on the page. The function lnkbtnPageNumber_Command is not being called. The scripts just not getting to it.

I’ve tried google but everywhere I’ve looked says that this code should work fine.

Here is the code which is being called by the function:

void lnkbtnPageNumber_Command(object sender, CommandEventArgs e)
{
    try
    {
        switch (e.CommandName)
        {
            case "GlobalID":
                gintDocketNumberPage = Convert.ToInt32(e.CommandArgument);
                break;
            case "CreatedDate":
                gintCreationDatePage = Convert.ToInt32(e.CommandArgument);
                break;
            case "Accounts":
                gintAccountPage = Convert.ToInt32(e.CommandArgument);
                break;
            case "CustomerRef":
                gintCustomerRef = Convert.ToInt32(e.CommandArgument);
                break;
            case "DepotRef":
                gintDepotRef = Convert.ToInt32(e.CommandArgument);
                break;
            default:
                gintDocketNumberPage = Convert.ToInt32(e.CommandArgument);
                break;
        }

I’m really stumped! please let me know if I’ve left out anything.

Thanks for any help you can provide!

I’ve just read somewhere that this code won’t work unless called from Page_Init which if true is a but of a pain cos I can’t put this function in Page_Init…

  • 1 1 Answer
  • 1 View
  • 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-16T22:14:10+00:00Added an answer on May 16, 2026 at 10:14 pm

    Where is this lnkbtnPageNumber, in the gridView Pager?
    If so, is it being regenerated on every postback or added f.e. in RowDataBound?
    The best place in that case would be in RowCreated because it will be called on every postback and all dynamic controls(and their events) must be recreated on postback.

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

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.