Composite Control has design time error in Certain Pages - c#

I have a solution in ASP.Net 2008 (C#) with:
- A Project with a Composite control (with some buttons and textboxes).
- Another project (application) just to test the control.
I started to test the control inside a page or webform. It had some design time errors
so when I dragged the control to the page it showed the "Error Rendering Control" in design time. I corrected the errors, rebuild the project with the control,
and the control appears fine in design time.
But I added another webform, I dragged the control on it, and the "Error Rendering Control"
appears again. I added another webforms and drag the control on them and that error appears too.
Any help would be appreciated.

Sorry, because I have a lot of code in my composite control, I didn't noticed that I had a .FindControl sentence inside my composite control. I put that senrtence just for testing, but I forgot to delete it from my code.
So the page when it worked fine had the control specified in FindControl, the other pages
had not.

Related

Visual Studio: Typing code vs. drag and drop from the control menu

I tried creating a gridview by typing code using another block of code on a different page as an example. I found that, when I ran the program and clicked the Edit button on a row, the fields did not change into textboxes for editing. I did have code to handle the Row Editing event.
In an earlier project I found that I had to double-click the Row Editing event in the Properties window for a gridview to create the event handling code. Typing in that code in the separate aspx.cs file did not work.
I am working with ASP.Net / C#.
What is going on with Visual Studio when I do drag and drop from the control menu as opposed to just typing in code? I am assuming it is adding something that I am missing when I am just typing.
Does anyone else have other examples that didn't work when they typed code that I should watch out for?
Even if you did a mighty good job copying the HTML, you likely still missed a few properties. That's because the GridView component comes with a bunch of so-called Design-Time properties that can (only) be configured from the Properties panel in Visual Studio.
I think you'll find that dragging a control from the toolbox onto your web form will set the control's design-time properties to a specific set of default values. This does not happen when you type the HTML by hand.

I can't click on Telerik controls in my WinForms application in Visual Studio

I’m having an issue w/ a WinForms app I built several months ago. I opened it yesterday for the first time in a few months, and I’m unable to click on any of the controls in the form (in Designer view). If I double-click any of the controls on the page, it opens up code for the Load event of the form, as if I double-clicked the form itself; it’s as if the form is on top of all other controls maybe? All of the controls on the form are Telerik controls. I've been working on this project in VS 2010 since its inception. I also tried opening it in VS 2012 this morning, but that didn't help.
If I drag a new Telerik control to the form, it vanishes instantly, as if it’s buried under all of the other controls. If I drag a non-Telerik control to the form (such as a standard textbox), it appears fine, and that control will respond to clicks (ie – the Properties window will populate w/ properties for that control).
After I noticed this issue yesterday, I reluctantly upgraded my Telerik WinForms controls to Q3 this morning, but that hasn’t helped anything.
For now, I was able to bypass the Designer view altogether, and I made changes via the Designer code class. However, I’ll be in trouble if I ever need to actually add a new Telerik control to this form. Any help is appreciated.
This seems like a missing design time assembly. Please have a look at the following articles for explanation and suggestions how to handle this: link link

ASP.NET Custom Server Control not refreshing in designer

I have a written an ASP.NET Custom Server Control, which I have working. This control inherits from CompositeControl and has different views that it can show during its life time. The best analogy would be similar to a Tab control where one control has many user selectable views depending on which tab the user selected. Before someone asks, no, mine is not a Tab control, it's an analogy that everyone should be familiar with.
Anyway, I want to have the view to be selectable in the Visual Studio 2010 designer. To do this, I created a CompositeControlDesigner with actions (just a single combobox to select the view). All of this works just fine, I have even stepped through the code in the debugger and verified that everything is firing off as expected including CreateChildControls back in the main control, but Visual Studio is NOT refreshing the screen. It only appears to refresh the designer if a tag is added/removed/modified on the control (which will not happen in this case since it is an designer-only feature)
Does anyone have a clue as to how to force the designer to refresh?

problem with pop up object list with visual-studio-2008

I'm developing ASP.net project with C# using vs visual-studio-2008. when I drag drop asp control from tool box to the design view then I go to the code behind I should see the control in pop up object list. at the begin I had no problem but not when I drag and drop any new control I can not see it and even if I write it manually when give me an error this this name not exist.
A few things:
- Can you compile your code? Compilation errors often cause problems with intelli-sense
- Is your designer properly connected to the code behind?
- Try making a new WebForm to see if you have the same problems there
- Any DLL references that are broken?

Double postback required for place holder control

Here's a fun problem. The page in question is wizard like page. here's the scenario-
User clicks on a link button to get to step 2 of the wizard. (The post back can't be avoided. URL based navigation isn't an option.)
User clicks on a radio button/link button/any control that requires a postback for client-server interaction.
The page reloads as if nothing happens.
User repeats step 2. Things work fine.
What I do is this -
I have just one page for all steps of the wizard. Based on the step, the appropiate control is loaded into the page. This control is added to a placeholder control in the OnLoad event. Doing so in OnInit or OnPreRender doesn't work. This step of adding introduces the odd behaviour I've described above.
Any ideas?
Since you're adding controls to your page at runtime to get the wizard to appear on one page, I think this is a simple matter of rearranging some of your code.
Refer to this article at CodeProject - specifically the section that discusses viewstate and dynamic controls in the section called - "Walkthrough 6: Viewstate and Dynamic Controls".
Very simple, you have to re-add control on each postback, re-attach event handlers and give dynamically loaded control same Id.
The application uses a custom control framework. The issue is related to the framework. Had to redesign the approach.

Categories

Resources