Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

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:
HTML
<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
            </div>



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:
ASP.NET
<form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1"
            Text="Populate Forename Label 2"
            OnClick="populateButton_Click"
            runat="server" />
        <br />
        <br />
        <asp:Label ID="GreetingLabel" runat="server"
            Visible="false" Text="Hello World!" />
    </div>
</form>


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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900