| | |
Binding from usercontrol
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2006
Posts: 45
Reputation:
Solved Threads: 0
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
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
You can bind the grid whenever you like.
The method is DataBind()
The method is DataBind()
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Bored? Visit http://www.kaelisspace.com/
•
•
Join Date: Sep 2006
Posts: 45
Reputation:
Solved Threads: 0
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
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
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.
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.
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Bored? Visit http://www.kaelisspace.com/
![]() |
Similar Threads
- Inharits userControl (C#)
- binding radio buttons (VB.NET)
- Binding Error with QBasic plz Help (Legacy and Other Languages)
- binding a datagrid to a datareader (ASP.NET)
- obsolete binding at `a' error C++ (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: Send Email From my Application
- Next Thread: Configuration Error
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax appliances asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn cac checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings rotatepage save search security serializesmo.table sessionvariables silverlight smartcard sql sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml youareanotmemberofthedebuggerusers





