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. Advertisements

  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. Advertisements

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. =?Utf-8?B?Q2hyaWlz?=

    2.0 Master Page Default Button

    =?Utf-8?B?Q2hyaWlz?=, Nov 18, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    5,704
    AmitGarg
    Mar 16, 2007
  2. Mark Olbert

    Master Page Button and Detail Page Button

    Mark Olbert, Jan 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    725
    Mark Olbert
    Feb 3, 2006
  3. =?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,701
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Mar 17, 2006
  4. Doug McCann
    Replies:
    1
    Views:
    1,399
    William Brogden
    Aug 5, 2004
  5. Laith Zraikat
    Replies:
    3
    Views:
    1,453
    Walter Wang [MSFT]
    Jul 6, 2006
  6. Zeba
    Replies:
    1
    Views:
    735
    Mark Rae
    Feb 22, 2007
  7. Nathan Sokalski
    Replies:
    25
    Views:
    1,846
    Nathan Sokalski
    Mar 4, 2010
  8. SerpentKiss2010
    Replies:
    0
    Views:
    2,745
    SerpentKiss2010
    Apr 6, 2011
Loading...