943,704 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 4527
  • ASP.NET RSS
Feb 20th, 2007
0

Binding from usercontrol

Expand Post »
Hi all,
I am trying to bind a grid(in webform1.aspx) from my user control.

The purpose is that, I have some cotrols in my usercontrols, and as the control's value changes, i have to rebind.

So, is there any possiblity to bind the grid(which is in say webform1.aspx) from my usercontrol's control event?(eg: button click event in usercontrol, can i bind the grid)

Hope someone will help me

thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Sarah Lee is offline Offline
45 posts
since Sep 2006
Feb 20th, 2007
0

Re: Binding from usercontrol

You can bind the grid whenever you like.
The method is DataBind()
Reputation Points: 13
Solved Threads: 4
Junior Poster in Training
nikkiH is offline Offline
79 posts
since Dec 2006
Feb 21st, 2007
0

Re: Binding from usercontrol

thanks

Actually, I have a usercontrol, and in all pages of my application, i have that usercontrol

I have a grid in say webform1.aspx, which i want to get populated when that page loads from the login page.

I am trying to do that from the usercontrol, suppliying the input data for it.

Also i am trying to bind it, when some values in the usercontrol is chaged.

eg: test.ascx
page_load(....)
bindgrid(input1, input2)

button1_click(.....)
input1 = new changed value
input2 = new changed value
bindgrid(input1, input2)

sub bindgrid(byval input1 as string, byval input2 as string)
.......
end sub

But on runing the application, from login page to webform, nothing displayed,
when i change some values, and hits the button, an excepton comes object reference not set

This is the real situation now, and without solving this, I cannot go further, unless if someone helps me to figure it out
Reputation Points: 10
Solved Threads: 0
Light Poster
Sarah Lee is offline Offline
45 posts
since Sep 2006
Feb 21st, 2007
0

Re: Binding from usercontrol

The first thing I would do is set up a test page using only the datagrid. Get it data bound and working normally.
Once that is set, then I'd add the code for the user control, and see if even putting it on the page caused an error.

If it's still all good, then I'd pop the login page to hit the test page.
Is there an error now?

Baby steps and test pages are great troubleshooting tools.

If you need more help, you need to post real code and the real error, or I can only make guesses at what might be going on.

Your user control may not be saving state as you expect if you're getting an object expected error.
Reputation Points: 13
Solved Threads: 4
Junior Poster in Training
nikkiH is offline Offline
79 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Send Email From my Application
Next Thread in ASP.NET Forum Timeline: Configuration Error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC