name:
password:
i have a code like this and button click is not firing in thhis code can any one help me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 28, 2013, 7:39 AM
Regards,
Iftikar
aditya immadiPosted Jul 28, 2013, 7:35 AM
Iftikar HussainPosted Jul 26, 2013, 6:51 AM
Regards,
Iftikar
Sanjeeb LenkaPosted Jul 26, 2013, 6:17 AM
aditya immadiPosted Jul 26, 2013, 6:10 AM
Thanks and Regards
aditya immadiPosted Jul 26, 2013, 5:42 AM
Iftikar HussainPosted Jul 26, 2013, 5:37 AM
Is your button event is not firing or inside the event handler the code is not getting executed? can you put the break point in below line and check
protected void btnlogin_Click(object sender, EventArgs e)
{
Regards,
Iftikar
aditya immadiPosted Jul 26, 2013, 5:29 AM
The page has one or more
correct the problem in code view:
head
this is my new page source code
<%@ Page Title="" Language="C#" MasterPageFile="~/master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ApComapaign.WebForm1" %>
Sanjeeb LenkaPosted Jul 26, 2013, 4:53 AM
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master.master.cs" Inherits="ApComapaign.master" %>
use this masterpage to create child page:
when you create child page two contentplaceholder will come:
write your code within 2nd content placeholder.
ex:-
your javascript code and css
your body content
aditya immadiPosted Jul 26, 2013, 4:45 AM
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master.master.cs" Inherits="ApComapaign.master" %>
Sanjeeb LenkaPosted Jul 26, 2013, 4:43 AM
Pankaj PandeyPosted Jul 26, 2013, 4:41 AM
by
and try again
aditya immadiPosted Jul 26, 2013, 4:40 AM
can you have another solution .because my total work is depends on this one
thanks and regards
Sanjeeb LenkaPosted Jul 26, 2013, 4:33 AM
i checked your code its working fine.
if the problem persists then delete the button and place a new one. and write the event for new one.
aditya immadiPosted Jul 26, 2013, 4:18 AM
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace ApComapaign
{
public partial class adminhome : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnlogin_Click(object sender, EventArgs e)
{
string constring = ConfigurationManager.ConnectionStrings["conn"].ToString();
SqlCommand cmd = new SqlCommand();
SqlConnection conn = new SqlConnection(constring);
cmd.Connection = conn;
conn.Open();
cmd.CommandText = "spadmin1";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("name", txtname.Text);
cmd.Parameters.AddWithValue("password", txtpwd.Text);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds != null && ds.Tables.Count > 0)
{
string status = ds.Tables[0].Rows[0][0].ToString();
if (status == "yes")
{
Session["name"] = ds.Tables[1].Rows[0]["name"].ToString();
Session["password"] = ds.Tables[1].Rows[0]["password"].ToString();
Response.Redirect("adminhome.aspx");
}
else
{
lblmsg.Text = "ivalid credentials";
}
}
}
}
}
Thanks and Regards
Sanjeeb LenkaPosted Jul 26, 2013, 3:52 AM