Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Monday, 26 August 2013

Retrieve Data Value which is transfer from one form to another by post method in asp.net

We can access form post value using Request.Form["parametername"] and the code are given below have a look on this topic and try this.......

if(Request.Form !=null)
{
    string name = Request.Form["name"].ToString();
    string email = Request.Form["email"].ToString();
    string mobile = Request.Form["mobile"].ToString();
    string city = Request.Form["city"].ToString();
    string state = Request.Form["state"].ToString();
}

Saturday, 3 August 2013

Find window forms attached by MDI Parent in C#

Try this code to close perticular open form or all open form.......

foreach (Form form in Application.OpenForms)
                            {
                                if (form.Name == "Login")
                                {
                                    form.Close();
                                }
                             // /* to close all open form */
                             //  form .Close();
                            }

Friday, 19 July 2013

Prevent Window form to Open when Same form Open Already

Try this code on Window(Form) Open Events it will close open form and open new form/window........

var form1 = new Formname();
                var openedForm = Application.OpenForms[form1.Name];
                if (openedForm != null)
                {
                    openedForm.WindowState = FormWindowState.Normal;
                    openedForm.BringToFront();
                    openedForm.Activate();
                }
                else
                {
                    // If required.
                    form1.MdiParent = this;
                    form1.Show();
                }