Click here to Skip to main content
15,883,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I downloaded a css template and I'm planning to use this as my website design. But how am I able to put codes here?
the code for buttons in my design is this

<a class="button" data-type="reset">Clear</a>

and i cant click it to put my codes in it.
when i try to change the button code into this

<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Clear" />

the design changes entirely and i'm getting errors when i tried to comiple it. same with the textboxes.

PLEASE HELP?
Posted
Comments
Suvendu Shekhar Giri 8-Jan-15 5:34am    
What's the error you are getting? It should work, you just need to add CssClass="button" to the asp button. What is you page extension? html or aspx?
Member 11360863 8-Jan-15 9:17am    
all the forms i downloaded in css template were all html forms but what i did was to copy all the the codes in the page source then pasted it in a new web form so it will be in an .aspx form. the error says:

Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'Button1_Click' is not a member of 'ASP.contacts_aspx'.
Suvendu Shekhar Giri 8-Jan-15 13:49pm    
Make sure that you have Button1_Click event in your cs page. What was the error you were getting for textbox? Let me know if problem is not resolved.
Member 11360863 11-Jan-15 12:41pm    
i tried adding manually the code for button1 in the cs page but it still gets the same error..

'Button1_Click' is not a member of 'ASP.contacts_aspx'.

if i double click the button, it should redirect me automatically to the cs page, right? and it will automatically show this

protected void Button1_Click(object sender, EventArgs e)
{

}

but what's happening is, whenever i double click the button, it just redirects me to the design codes and generates this one

Protected Sub Button1_Click(sender As Object, e As EventArgs)

End Sub

obviously i can't put codes on that one because it's on the source page of the design.. :(
Suvendu Shekhar Giri 12-Jan-15 6:50am    
I suspect you have forgotten to check the checkbox 'Place code in separate file' while creating the page and you have also selected the language to be vb.net instead of cs, i guess. Can you try creating a new page and copying the design to that page? This time make sure that you have considered above 2 points.

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