Last post Jul 01, 2018 06:58 AM by Haashim
Jun 30, 2018 02:54 PM|Haashim|LINK
Hi i am working on a web project in asp.net using c# ... well i have created perfectly my First aspx page as my login page .. when i enter username and password it checks from sql database and if its correct then my code just show me the Message that "Successfully
Login" After that it come back to the same aspx login page....!! In my project i have C# form name as "Form1.cs" which i have designed as homepage i just want to connect these two forms like when my aspx form successfully logins it should connect to Form1.cs
my second homepage form.....!!
Kindly Guide me how to do that ....!!!
Thats my Code of index.axpx.cs (My First Login Page)
public partial class index : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
protected void Button1_Click(object sender, EventArgs e)
protected void Button1_Click1(object sender, EventArgs e)
string constr = WebConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand("select count(*) from aspnew where username='" + txtuser.Text + "' and password ='" + txtpass.Text + "' ", con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
if (dt.Rows.ToString() == "1")
Response.Write("<script>alert('Successful in Login')</script");
// here i need to do something i guess ????????
Response.Write("<script>alert('Error in Login')</script");
catch (Exception ex)
Jun 30, 2018 06:32 PM|mudassarkhan|LINK
Is your Form1.cs in a Windows App?
If yes then it is not possible to Connect as Web and Windows App are two different domains.
Jun 30, 2018 06:55 PM|Haashim|LINK
well m confused i think its a window app...???
tell me how i send you images of my project so you can understand that and tell me if its windows app or web app ....
m totally new....
Jun 30, 2018 07:04 PM|Haashim|LINK
tell me the alternative way to connect those 2 form. should i have to make my all forms in .cs then it will work ??? if this is a solution then it means i have to re make the first form into .cs windows forms ... am i right ???
Jun 30, 2018 07:21 PM|mudassarkhan|LINK
ASPX is a Web Form. A Web App runs in browser.
Form1.cs a Windows App. Needs to be installed in Windows OS.
Both cannot be connected. You cannot redirect from Web App to Windows.
Jul 01, 2018 06:58 AM|Haashim|LINK
Yeah i got it Thanks For Info .....!!!