Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have buttons and dropdownlist on my aspx page.when i set the EnableViewState = "false" in the
page directive tag then the button click event is not firing.Why?
Posted
Comments
Deviprasad Das 10-Jan-14 6:37am    
Can you please share the code?
Karthik_Mahalingam 10-Jan-14 6:40am    
post your button tag
Sumit Bhargav 10-Jan-14 6:43am    
my button tag is
<asp:Button ID="BttnDelete" CssClass="Bttn" Font-Bold="true" runat="server" CommandArgument='<%# Eval("Id") %>' OnCommand="BttnDelete_Click" meta:resourcekey="BttnDeleteResource1" OnClientClick="return ErrorMsge();" />

Please check you button event in button tag. EnableViewState="false" does not create any effect on button. So check your event name on code behind and onclick property of button.

ASP.NET
<asp:button id="btnSubmit" runat="server" onclick="btnSubmit_Click" xmlns:asp="#unknown" />


C#
protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Response.Write("Test");
        }
 
Share this answer
 
May be you can try with this property 'AutoEventWireup' making it 'true', however I must say you need to make EnableViewState true, Just try above settings and check.
 
Share this answer
 
There was an error in code behind and hence it wasn't showing anything.
Thanks all of you
 
Share this answer
 
Comments
RaviRanjanKr 10-Jan-14 8:08am    
Use Have a question or comment instead of posting as an answer :)

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


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