Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. user control Problem

user control Problem

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ajeet mittal
    wrote on last edited by
    #1

    Hi, I am using asp.net 2005. I have a problem with usercontrol. I have a usercontrol on my aspx page. In usercontrol there is a button. on click event of usercontol button i have to fill gridview which is present on aspx page. can any one tell me how i will do it. thanking u.

    E 1 Reply Last reply
    0
    • A Ajeet mittal

      Hi, I am using asp.net 2005. I have a problem with usercontrol. I have a usercontrol on my aspx page. In usercontrol there is a button. on click event of usercontol button i have to fill gridview which is present on aspx page. can any one tell me how i will do it. thanking u.

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      well fire the event for filling the gridview on the onclick event of the button there are plenty of tutorials for binding data to a gridview and its fairly straightforward

      We are not a Code Charity

      A 1 Reply Last reply
      0
      • E eyeseetee

        well fire the event for filling the gridview on the onclick event of the button there are plenty of tutorials for binding data to a gridview and its fairly straightforward

        We are not a Code Charity

        A Offline
        A Offline
        Ajeet mittal
        wrote on last edited by
        #3

        thanks for replaying me. but the problem is my button is in usercontrol and gridview is in aspx page. how i fire event of usercontrol in aspx page. please tell me.

        E G 2 Replies Last reply
        0
        • A Ajeet mittal

          thanks for replaying me. but the problem is my button is in usercontrol and gridview is in aspx page. how i fire event of usercontrol in aspx page. please tell me.

          E Offline
          E Offline
          eyeseetee
          wrote on last edited by
          #4

          check this out: http://forums.asp.net/p/1279478/2441374.aspx and this http://forums.asp.net/p/1262933/2365263.aspx

          We are not a Code Charity

          1 Reply Last reply
          0
          • A Ajeet mittal

            thanks for replaying me. but the problem is my button is in usercontrol and gridview is in aspx page. how i fire event of usercontrol in aspx page. please tell me.

            G Offline
            G Offline
            Gayani Devapriya
            wrote on last edited by
            #5

            Hi, Sorry for the delay...there was a problem in the site.. You need to raise an event to the page. Here is how to do it. First let’s create delegate and define an event of type of the delegate. And call that event in the button click event. Add this code your ascx.cs file public delegate void LoadGridHandler(); public event LoadGridHandler LoadGrid; protected void Button1_Click(object sender, EventArgs e) { this.LoadGrid(); } Now, in your aspx file, raise that event during the page load of your page. Take this code.. protected void Page_Load(object sender, EventArgs e) { MyControl1.LoadGrid += new Controls_MyControl.LoadGridHandler(MyControl1_LoadGrid); } void MyControl1_LoadGrid() { //write the method to load you grid Response.Write("Hi from Gayani"); } Hope it works Thx, Gayani

            A 1 Reply Last reply
            0
            • G Gayani Devapriya

              Hi, Sorry for the delay...there was a problem in the site.. You need to raise an event to the page. Here is how to do it. First let’s create delegate and define an event of type of the delegate. And call that event in the button click event. Add this code your ascx.cs file public delegate void LoadGridHandler(); public event LoadGridHandler LoadGrid; protected void Button1_Click(object sender, EventArgs e) { this.LoadGrid(); } Now, in your aspx file, raise that event during the page load of your page. Take this code.. protected void Page_Load(object sender, EventArgs e) { MyControl1.LoadGrid += new Controls_MyControl.LoadGridHandler(MyControl1_LoadGrid); } void MyControl1_LoadGrid() { //write the method to load you grid Response.Write("Hi from Gayani"); } Hope it works Thx, Gayani

              A Offline
              A Offline
              Ajeet mittal
              wrote on last edited by
              #6

              thanks a lot. i fixed my problem.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups