hii,,,i m using asp.net 2005
i have given login control manually using forms authentication and all..
on proper username and password it opens first.aspx....everything is workin fine.
what i want is tht first.aspx should open in a pop up window with specific height and width.heres the code for login

<script language="C#" runat="server">
		void Login_Click(Object sender, EventArgs e) {

      // authenticate user: this samples accepts only one user with
      // a name of 'admin' and a password of 'password'

      if ((TextBox1.Text == "admin") && (TextBox2.Text == "admin"))
       {
        FormsAuthentication.RedirectFromLoginPage(TextBox1.Text,CheckBox1.Checked);
       Response.Redirect("First.aspx"); 
          }
            
      else {
        Label1.Text = "Invalid User";
      }
    }
		</script>

any solution,,,,pls respond as soon as possible
thnks in advance:)

As far as I know, pop up window can be done in asp.net window based application. However, I don't think asp.net web based application support pop up window. But if I m not wrong, it can be done by using javascript in the coding.

string script = "window.open('First.aspx','mainwin','width=1014px,height=700px,top=0,left=0;');";
          ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", script, true);

well this is wht i found,,and its workin ,,however for this code to execute i had to remove formsauthentication,,,,,,i am still looking for an answer..reply asap,,thnks in advance

hi
as you have no db transaction you must do this using client side scripting. the way you are using is unnecessarily westing server time.

hi
as you have no db transaction you must do this using client side scripting. the way you are using is unnecessarily westing server time.

hii,sbv,,,well currently i dont have any db connections,,,but in future the username and password will b checkd from the database only...,
thnks for ur help

no way around it with asp.net membership. It won't even load the page for your script to be registered, so it will never get fired. You will have to "allow" users to view all pages, then set up a function that registers the script if the page is members-only and the user is not logged in.

no way around it with asp.net membership. It won't even load the page for your script to be registered, so it will never get fired. You will have to "allow" users to view all pages, then set up a function that registers the script if the page is members-only and the user is not logged in.

well i have used the web.config file to allow and deny users through authentication and authorization....i really dont hav any idea wht u ppl are talkin abt,,pls explain

using membership (with the web.config files to allow or deny users to a page), has a drawback. An unregistered user will never see the page, period. ASP.NET Membership will automatically redirect to the login page.

If you wish the user to see the page, allow all users to see it. Then, during page_load, check to see if the user is registered. If he/she isn't registered, you need to call a javascript function, or set one in the head part of the document. This is done by registering a client script. That script can black out, or partially black out, the page. Then another part in javascript can "alert" the user, or you can display a div with the contents you would like them to see.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.