How can I keep the dropdownlist from populating my gridview?

Discussion in 'ASP .Net' started by needin4mation@gmail.com, Sep 10, 2006.

  1. Guest

    I have a gridview and a dropdownlist. If I change the ddl, the
    gridview populates. That is what I want. But what I don't want is for
    it to happen the first time they get to the page. I know I can add a
    "Select Item," but is that the correct way to do it? I don't want it
    to hit the database at all the first time the page loads. I have done
    everything through visual studio and was trying to see if I could do
    this with no code behind. Thanks.
     
    , Sep 10, 2006
    #1
    1. Advertising

  2. You need to check page property IsPostBack.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    <> wrote in message
    news:...
    >I have a gridview and a dropdownlist. If I change the ddl, the
    > gridview populates. That is what I want. But what I don't want is for
    > it to happen the first time they get to the page. I know I can add a
    > "Select Item," but is that the correct way to do it? I don't want it
    > to hit the database at all the first time the page loads. I have done
    > everything through visual studio and was trying to see if I could do
    > this with no code behind. Thanks.
    >
     
    Eliyahu Goldin, Sep 10, 2006
    #2
    1. Advertising

  3. Guest

    So I cannot do this solely using the GUI? I will have to code it in
    the page_load? Thanks.


    Eliyahu Goldin wrote:
    > You need to check page property IsPostBack.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer & Consultant
    > Microsoft MVP [ASP.NET]
    >
    >
    > <> wrote in message
    > news:...
    > >I have a gridview and a dropdownlist. If I change the ddl, the
    > > gridview populates. That is what I want. But what I don't want is for
    > > it to happen the first time they get to the page. I know I can add a
    > > "Select Item," but is that the correct way to do it? I don't want it
    > > to hit the database at all the first time the page loads. I have done
    > > everything through visual studio and was trying to see if I could do
    > > this with no code behind. Thanks.
    > >
     
    , Sep 12, 2006
    #3
  4. Yes.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    <> wrote in message
    news:...
    > So I cannot do this solely using the GUI? I will have to code it in
    > the page_load? Thanks.
    >
    >
    > Eliyahu Goldin wrote:
    >> You need to check page property IsPostBack.
    >>
    >> --
    >> Eliyahu Goldin,
    >> Software Developer & Consultant
    >> Microsoft MVP [ASP.NET]
    >>
    >>
    >> <> wrote in message
    >> news:...
    >> >I have a gridview and a dropdownlist. If I change the ddl, the
    >> > gridview populates. That is what I want. But what I don't want is for
    >> > it to happen the first time they get to the page. I know I can add a
    >> > "Select Item," but is that the correct way to do it? I don't want it
    >> > to hit the database at all the first time the page loads. I have done
    >> > everything through visual studio and was trying to see if I could do
    >> > this with no code behind. Thanks.
    >> >

    >
     
    Eliyahu Goldin, Sep 12, 2006
    #4
  5. Guest

    Here's my problem. Since I put everything in the front I'm not sure
    what to put in the page behind. It's got the objectdatasource control
    in the "regular" .aspx page.

    How can I tell the grid not to fire if all the "stuff" is in the .aspx
    file?


    Eliyahu Goldin wrote:
    > Yes.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer & Consultant
    > Microsoft MVP [ASP.NET]
    >
    >
    > <> wrote in message
    > news:...
    > > So I cannot do this solely using the GUI? I will have to code it in
    > > the page_load? Thanks.
    > >
    > >
    > > Eliyahu Goldin wrote:
    > >> You need to check page property IsPostBack.
    > >>
    > >> --
    > >> Eliyahu Goldin,
    > >> Software Developer & Consultant
    > >> Microsoft MVP [ASP.NET]
    > >>
    > >>
    > >> <> wrote in message
    > >> news:...
    > >> >I have a gridview and a dropdownlist. If I change the ddl, the
    > >> > gridview populates. That is what I want. But what I don't want is for
    > >> > it to happen the first time they get to the page. I know I can add a
    > >> > "Select Item," but is that the correct way to do it? I don't want it
    > >> > to hit the database at all the first time the page loads. I have done
    > >> > everything through visual studio and was trying to see if I could do
    > >> > this with no code behind. Thanks.
    > >> >

    > >
     
    , Sep 12, 2006
    #5
  6. Are you asking how to add some code to an aspx page? You can add a
    service-side script to the aspx page. Would you call it "in the front"? You
    can't use asp.net without writing a line of code. This is a sort of
    professional technology, it needs a professional approach.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    <> wrote in message
    news:...
    > Here's my problem. Since I put everything in the front I'm not sure
    > what to put in the page behind. It's got the objectdatasource control
    > in the "regular" .aspx page.
    >
    > How can I tell the grid not to fire if all the "stuff" is in the .aspx
    > file?
    >
    >
    > Eliyahu Goldin wrote:
    >> Yes.
    >>
    >> --
    >> Eliyahu Goldin,
    >> Software Developer & Consultant
    >> Microsoft MVP [ASP.NET]
    >>
    >>
    >> <> wrote in message
    >> news:...
    >> > So I cannot do this solely using the GUI? I will have to code it in
    >> > the page_load? Thanks.
    >> >
    >> >
    >> > Eliyahu Goldin wrote:
    >> >> You need to check page property IsPostBack.
    >> >>
    >> >> --
    >> >> Eliyahu Goldin,
    >> >> Software Developer & Consultant
    >> >> Microsoft MVP [ASP.NET]
    >> >>
    >> >>
    >> >> <> wrote in message
    >> >> news:...
    >> >> >I have a gridview and a dropdownlist. If I change the ddl, the
    >> >> > gridview populates. That is what I want. But what I don't want is
    >> >> > for
    >> >> > it to happen the first time they get to the page. I know I can add
    >> >> > a
    >> >> > "Select Item," but is that the correct way to do it? I don't want
    >> >> > it
    >> >> > to hit the database at all the first time the page loads. I have
    >> >> > done
    >> >> > everything through visual studio and was trying to see if I could do
    >> >> > this with no code behind. Thanks.
    >> >> >
    >> >

    >
     
    Eliyahu Goldin, Sep 12, 2006
    #6
  7. Guest

    No, I guess I wasn't clear. Sorry. I don't mind coding. I shouldn't
    have to in this case, at least I thought.

    I ended up being right and half right to begin with. I added an item
    to my dropdownlist (-- select item --) and then set the value to -1, as
    there is no -1 in my database. I then set the AppendDataBoundItems
    setting in the dropdownlist to true so that the new --select item--
    wouldn't be lost when the dropdownlist was populated by items from the
    database. No coding beyond the .aspx page necessary.

    Eliyahu Goldin wrote:
    > Are you asking how to add some code to an aspx page? You can add a
    > service-side script to the aspx page. Would you call it "in the front"? You
    > can't use asp.net without writing a line of code. This is a sort of
    > professional technology, it needs a professional approach.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer & Consultant
    > Microsoft MVP [ASP.NET]
    >
    >
    > <> wrote in message
    > news:...
    > > Here's my problem. Since I put everything in the front I'm not sure
    > > what to put in the page behind. It's got the objectdatasource control
    > > in the "regular" .aspx page.
    > >
    > > How can I tell the grid not to fire if all the "stuff" is in the .aspx
    > > file?
    > >
    > >
    > > Eliyahu Goldin wrote:
    > >> Yes.
    > >>
    > >> --
    > >> Eliyahu Goldin,
    > >> Software Developer & Consultant
    > >> Microsoft MVP [ASP.NET]
    > >>
    > >>
    > >> <> wrote in message
    > >> news:...
    > >> > So I cannot do this solely using the GUI? I will have to code it in
    > >> > the page_load? Thanks.
    > >> >
    > >> >
    > >> > Eliyahu Goldin wrote:
    > >> >> You need to check page property IsPostBack.
    > >> >>
    > >> >> --
    > >> >> Eliyahu Goldin,
    > >> >> Software Developer & Consultant
    > >> >> Microsoft MVP [ASP.NET]
    > >> >>
    > >> >>
    > >> >> <> wrote in message
    > >> >> news:...
    > >> >> >I have a gridview and a dropdownlist. If I change the ddl, the
    > >> >> > gridview populates. That is what I want. But what I don't want is
    > >> >> > for
    > >> >> > it to happen the first time they get to the page. I know I can add
    > >> >> > a
    > >> >> > "Select Item," but is that the correct way to do it? I don't want
    > >> >> > it
    > >> >> > to hit the database at all the first time the page loads. I have
    > >> >> > done
    > >> >> > everything through visual studio and was trying to see if I could do
    > >> >> > this with no code behind. Thanks.
    > >> >> >
    > >> >

    > >
     
    , Sep 13, 2006
    #7
    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. amessimon
    Replies:
    3
    Views:
    12,908
    niranjan44
    Jun 2, 2011
  2. =?Utf-8?B?Q0hSSVM=?=

    Problem populating dropdownlist control

    =?Utf-8?B?Q0hSSVM=?=, Apr 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    346
    Cowboy \(Gregory A. Beamer\)
    Apr 13, 2004
  3. Wim
    Replies:
    1
    Views:
    460
  4. =?Utf-8?B?YmlsbCB0aWU=?=

    problem populating gridView on dropDownList

    =?Utf-8?B?YmlsbCB0aWU=?=, Apr 26, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    618
    Vlad Iliescu
    Apr 27, 2006
  5. hisan
    Replies:
    1
    Views:
    1,406
    Dan Stromberg
    Jun 25, 2012
Loading...

Share This Page