Click here to Skip to main content
13,800,683 members
Rate this:
Please Sign up or sign in to vote.

I bought a configurable admin template from ThemeForest but I could no with some advise on how to configure it.

I'm sure what I'm trying to do is really simple, but I'm not great with HTML.

Here's a simple example.

Using the purchased template, I can create a label and a button like this:
<label for="input-1" class="label">Forename</label>
            <input type="text" name="Forename" id="Forename" value="" class="input">
            <br />

            <div class="button margin-right" id="btnSave" onclick="populateButton_Click">
                Populate Forename Label 1

Then, I need a populateButton_Click method to actually populate the label with text held in a variable.

All of the documentation for the template I bought is here

What I have tried:

I've looked at tutorials on this, but they all seem to use a different method to the one I need.

For example, the regular method seems to be to create a button like this:
<form id="form1" runat="server">
        <asp:Button ID="Button1"
            Text="Populate Forename Label 2"
            runat="server" />
        <br />
        <br />
        <asp:Label ID="GreetingLabel" runat="server"
            Visible="false" Text="Hello World!" />

Then have the method called do the update (in this example it's updating the button text but I'll be updating the label created in the first code block:

void Page_Load(Object sender, EventArgs e)
    // Manually register the event-handling method for
    // the Click event of the Button control.
    Button1.Click += new EventHandler(this.populateButton_Click);


void populateButton_Click(Object sender,
                       EventArgs e)
    // When the button is clicked,
    // change the button text, and disable it.

    Button clickedButton = (Button)sender;
    clickedButton.Text = "...button clicked...";
    clickedButton.Enabled = false;

    // Display the greeting label text.


So, it looks like my template uses button and label 'classes' rather than the standard asp:button or asp:label. How can I capture the click event and then update the values/text in these classes?
Posted 10-Nov-17 2:06am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.181215.1 | Last Updated 10 Nov 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100