in master page, setting default button

Discussion in 'ASP .Net' started by Dev, Mar 22, 2006.

  1. Dev

    Dev Guest

    hi
    i have master page in which i have form and now in content page i need
    to set the defaultbutton. now i have one solution for that in content
    page

    "HtmlForm mainform = (HtmlForm)Master.FindControl("frmMain");
    mainform.DefaultButton = btnSave.UniqueID;"
    i have use this code that solve my problem

    but now main problem is that i have around 500 page in which i have to
    modify the page
    can any body give me any idea hw can i solve this problem by adding
    code in master page

    Thanks in advance
    Dev
     
    Dev, Mar 22, 2006
    #1
    1. Advertising

  2. You could calso expose the control as a property of the master page then
    access it through Master.ControlName but i am not sure if that would be any
    easier. If you are converting an existing site to using master pages i think
    the only way to do it is to do a good old fashioned search and reaplce across
    all your child pages.



    "Dev" wrote:

    > hi
    > i have master page in which i have form and now in content page i need
    > to set the defaultbutton. now i have one solution for that in content
    > page
    >
    > "HtmlForm mainform = (HtmlForm)Master.FindControl("frmMain");
    > mainform.DefaultButton = btnSave.UniqueID;"
    > i have use this code that solve my problem
    >
    > but now main problem is that i have around 500 page in which i have to
    > modify the page
    > can any body give me any idea hw can i solve this problem by adding
    > code in master page
    >
    > Thanks in advance
    > Dev
    >
    >
     
    =?Utf-8?B?Y2xpY2tvbg==?=, Mar 22, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Olbert

    Master Page Button and Detail Page Button

    Mark Olbert, Jan 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    631
    Mark Olbert
    Feb 3, 2006
  2. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    <form> in master page, setting default button and 1st control

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 10, 2006, in forum: ASP .Net
    Replies:
    12
    Views:
    3,544
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Mar 17, 2006
  3. Doug McCann
    Replies:
    1
    Views:
    1,107
    William Brogden
    Aug 5, 2004
  4. Laith Zraikat
    Replies:
    3
    Views:
    1,249
    Walter Wang [MSFT]
    Jul 6, 2006
  5. Nathan Sokalski
    Replies:
    25
    Views:
    1,481
    Nathan Sokalski
    Mar 4, 2010
Loading...

Share This Page