Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0
I have a small web application which is running well on my local machine but once I deploy my site to the server, all the other buttons click events are working except for one button event which is not firing:
 public void checkpassword(object sender,EventArgs e)
    {
        
        string password = txtpassword.Text.ToString();
        SqlConnection con = new SqlConnection(connect);
        SqlCommand command = new SqlCommand("matchpassword",con);
        con.Open();
        command.CommandType = CommandType.StoredProcedure;
 
        SqlDataAdapter sqlDALogin1 = new SqlDataAdapter();
        DataSet sqlDSLogin1 = new DataSet();
        sqlDALogin1.SelectCommand = command;
        sqlDALogin1.Fill(sqlDSLogin1, "Password");
       
        string passwrd = Convert.ToString(sqlDSLogin1.Tables[0].Rows[0]["Password"]);
        con.Close();
 
        if (password == passwrd)
        {
 
        }
        else
        {
            //Response.Redirect("ViewRecords.aspx");
            lbldisplay.Text = "Wrong Password";
            panelpassword.Update();
            ModalPassword.Show();
        }
 
    } 
<asp:Panel ID="Panel1" runat="server" CssClass="HellowWorldPopup2" Style="display:none">
             <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                 <ContentTemplate>
 
                     <asp:Button ID="BtnOK" runat="server" Text="OK" CssClass="lb-testright" OnClick="checkpassword"
                       />
                     <asp:Button ID="BtnCancel" runat="server" Text="Cancel" CssClass="lb-testleft" OnClick="redirecttorecords" />
                      <asp:Button ID="Button1" runat="server" Text="Cancel" Style="display:none" />
                     <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
                     <asp:TextBox ID="txtpassword" runat="server" CssClass="lb-textbox"
                         TextMode="Password" onfocus="clearContents(this);">Password </asp:TextBox>
 
             <asp:ModalPopupExtender ID="Modal_Password" runat="server"
               TargetControlID="Button1" PopupControlID="Panel1" DropShadow="true" >
             </asp:ModalPopupExtender>
             </ContentTemplate>
             </asp:UpdatePanel>
        </asp:Panel>
 
This is working fine on my machine but what doesn't work when deployed.
Thanks
Posted 15-Nov-12 12:22pm
Edited 15-Nov-12 14:19pm
v2
Comments
Christian Graus at 15-Nov-12 18:39pm
   
Why on earth does your proc return the password instead of comparing it in the DB ? An update panel means AJAX, have you looked at it in fiddler to see what is happening ? Are your other events also via AJAX ? Is ASP.NET AJAX installed on the server ? Have you looked at it in chrome for JS errors ?
Member 9291223 at 15-Nov-12 19:02pm
   
Yes all the requirement are installed. Event the cancel button event on that same modalpopup is working fine.Its just the Ok button isn't working
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Thanks everyone for your contributions. The solution to the issue was that I had to set the properties in the sql server database stored procedure and grant access execute access to the public
 
Thanks Again Everyone
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi ,
Check this asyncpostbacktrigger
 
<asp:Panel ID="Panel1" runat="server" CssClass="HellowWorldPopup2" Style="display:none">
             <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                 <ContentTemplate>
 
                     <asp:Button ID="BtnOK" runat="server" Text="OK" CssClass="lb-testright" OnClick="checkpassword"
                       />
                     <asp:Button ID="BtnCancel" runat="server" Text="Cancel" CssClass="lb-testleft" OnClick="redirecttorecords" />
                      <asp:Button ID="Button1" runat="server" Text="Cancel" Style="display:none" />
                     <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
                     <asp:TextBox ID="txtpassword" runat="server" CssClass="lb-textbox"
                         TextMode="Password" onfocus="clearContents(this);">Password </asp:TextBox>
 
             <asp:ModalPopupExtender ID="Modal_Password" runat="server"
               TargetControlID="Button1" PopupControlID="Panel1" DropShadow="true" >
             </asp:ModalPopupExtender>
             </ContentTemplate>
 <triggers>  
                <asp:asyncpostbacktrigger controlid="BtnOK" eventname="Click" xmlns:asp="#unknown" />  
            </triggers>  
             </asp:UpdatePanel>
        </asp:Panel>
 
http://msdn.microsoft.com/en-us/library/system.web.ui.asyncpostbacktrigger.aspx[^]
 
http://asp-net-example.blogspot.com/2009/11/ajax-asyncpostbacktrigger-how-to-use.html[^]
Best Regards
M.Mitwalli
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 448
1 Sergey Alexandrovich Kryukov 425
2 Abhinav S 408
3 sanket saxena 285
4 Tadit Dash 160
0 Sergey Alexandrovich Kryukov 8,482
1 OriginalGriff 4,830
2 Peter Leow 3,794
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid