ASP.NET - Elements disappear on the design view after updating XAML source - asp.net

I think this is a bug in Visual Studio but again I'll try my chance to get a solution for this. I've recently had a problem with my form elements becoming invisible after editing the XAML source. Let's say I want to add a list item to a dropdownlist. If I do it visualy in the design view there's no problem, but if I directly change it in the XML source all the elements in one of the divs disappear and I get "Error creating control Unknown service tag 'uc1:DatePicker'". (Datepicker is my User Control and I've had a lot of headache with it.). However I can see them in the source. Each time I touch the source I have to close and reopen the aspx page.

Related

Adding control from the Source and generate it in the designer.vb?

The problem that I'm having is that the design of an .aspx has a lot of controls that a lot of things are collapsed and pretty much impossible to visual the page as it should be from the Visual Studio.
Because of that, I can't add like a CheckBoxList from the toolbox directly to the Design window next to a <label> for example.
So I have to work from the Source and add that CheckBoxList from there, let's say inside a <tr> and next to a <td> with a <label>.
<asp:CheckBoxList runat="server">
</asp:CheckBoxList>
One question I have is, why doesn't the designer.vb auto-generate (add) the CheckBoxList control unless I specify an ID to it?
After I add that control from the source, is it possible to open up the Property Window (since I wouldn't be able to find/rightclick from the Design window? And also how can I create an event for that control?
Is it possible to reorganize that .aspx design and basically rearrange everything
and make it look like when I visualize it from the browser?
Is it possible to reorganize that .aspx design and basically rearrange
everything and make it look like when I visualize it from the browser?
It seems like you come from WinForms background. Web Form Designer window won't normally match up with what we see inside a browser. So, we - web developers - do not use Designer.
Changing a markup while debugging doesn't need to recompile the application, so we just press F5 to refresh the browser. My suggestion will be not to use Designer at all, because there is no Designer Window in ASP.NET MVC.
FYI: I use Resharper which displays intelligence for events, when I partially type event name inside the source. Then when I press enter, it automatically creates the event in Code Behind file.

Visual Studio 2013 will not show design view

I'm having a problem with Visual Studio 2013, the latest build off MSDN.
When in an ASP.Net application I cannot see the design view. When I switch to design view all I see is the message Loading Master Page... in the upper left hand corner.
Anyone else see this issue or have a work around?
It looks like you have added some controls which has come constructor logic failing due to some dependency that is causing your form not to open in design mode.
Try move your control from Form designer & add the control in code editor in Form Load event .
Also try to debug your code.
I'm facing the same problem, it actually does display in designer but takes a lot more time like mine took approx 10 minutes. In my case I'm using 2 ListViews and a nested listviews with their datasources and nested master pages. So I think it makes sense to take time in loading the designer.
At the solution explorer, right click on the file and select open with then select -Web Forms Editor- you can set it as default if you want. To see the code, right click on the file and select -View Mark Up - I hope it helps.

RadComboBoxItem hide() on client-side not persisting

What are you doing?
Using a RadComboBox, I'm hiding items from the user view under certain conditions.
What's the problem?
The combo items hide perfectly, however, when I click the combo box and then click anywhere else on the page (in other words, loose focus after focusing on the combobox) all the items I have hidden become visible again.
What else have you tried?
Thinking maybe I am not using the Telerik RadCombo Client Side API correctly, I decided to check whether deleted or disabled items would also magically re-appear when focusing and unfocusing from the RadComboBox.
The result; this issue only happens when hiding items, not when deleting or disabling RadComboBox items.
Demo of problem
For clarity and convenience, I've setup a page which very simply demonstrates the problem.
Download TestRadComboItemHide.zip and extract TestRadComboItemHide.aspx.
Place this ASPX into a website/webapp project and run ensuring you have telerik dll in the bin or Telerik installed on your dev computer.
Additional info
I've requsted assistance on Telerik support forums. (24 hours ago,
nothing helpful response as yet)
Using RadControls for ASP.NET AJAX Q1 2010: 2010.1.415.40
The work around to the problem is posted on the telerik forums. The solution was provided by another forum member, not Telerik.

Strange Problem with asp.net website

I've built an asp website and i have the following issues:-
i'm using a master page in it and have defined two contentplaceholders one in head one in content, and i've specified the page title in the top most directive at the #page directive but the page title doesn't show up. I have to manually add a tag for it.
Secondly when i create a content page from a master page it creates it and when i rename it, it doesn't rename it's class. It remains _Default, thus every page was having an inherit to _default.
Most importantly
I'm using a page to enter and view data to the database. I've used a boolean called isadmin which i set according to credentials at page load. and i'm added a panel where it's visible property is set to Visible = '<%#IsAdmin %>'. It works properly when i run it through the visual studio environment but when i publish it and run it doesn't work and the panel just comes and stays there. Why is it happening? Any idea?
Thanks
The Visible problem is fixed as i had to enable windows authentication on the server. Awaiting answers for the other two issues. Thanks
Try to add a <head runat=server> to the master page. Only then ASP.net can "see" the tag and modify it
It is not that bad that several aspx-pages have identical class names. ASP.NET 2.0 started to process every page as its own compiling unit or so. Pages cannot see each other. There is a special directive to make pages see each other and instanciate or manipulate them. So it should not do much harm
Maybe you did not test this correctly and are mistaken that it DOES work in Visual Studio??? But in any case I would suggest that you move your logic into OnInit, then it runs much earlier. I think the control tree is build before Page.OnLoad. What you do is data binding, that might run only if DataBind is called, I'm not sure
Or use the safe way: Make IsAdmin a property so that it initializes itself on first call and caches the result in a variable
Regarding question #2 - add your content pages via Project -> Add New Item, and name it appropriately there. That way the naming is consistent and correct throughout.
Regarding #3, what HTML is output when you run it from the server?
your first issue can be solved by filling out the title part of the #Page directive in your .aspx pages. The master page will display that text in the browsers title bar.
and prob #2 should be solved by adding the files using the file add option in visual studio.

Alternative UI control for large data lists instead of DropDownList

I am using C# and ASP.NET with version 2.0 of the .NET Framework library on this particular project. We are also using the AjaxControlToolkit. The AjaxControlToolkit should have the controls available to make a descent User Interface solution to the problem I'm facing.
I have run into this in a few projects in the last year, and used different solutions in the past. The current design of the project I just picked up, is that there is an <asp:DropDownList> control and on page load a Database call is made to get a list of values. This is then bound using DropDownList's datasource. The problem is that there is 25k items returned from the database. First thing, that's not acceptable for a user to have to scroll through tens of thousands of items. But, even more importantly, is that in every browser that it is tested on (IE 7, FF 3, Safari, and Chrome) the browser completely hangs as it is propagating the dropdownlist items.
What I'm thinking is using a Modal Popup form, which an Autocomplete Extender that allows the user to drill down to a specific company. So, in the field where they have to choose a company, they click on a "select company" icon, the modal form comes up, letting them use the autocomplete extender to select an existing company. They click "Ok" and it save the value to the field.
However, I'm an old school command line/shell/terminal guy, and my ideas of acceptable UI design might be skewed (give me a command prompt on any system, and I'm good to go). I would like the advice of those in the community here as to what they think would be an acceptable solution, or if they have faced other issues like this.
I think your idea for the autocomplete extender is the best solution. I've had this problem as well (sounds similar--a project you are taking over from somebody else). The push-back often comes from the user side. They are used to being able to select from a list of items. Unfortunately as the database grows, this becomes less and less feasible.
But when you have 0.5MB of html downloaded on the page (not including the viewstate), compromises have to be made.
Why do you think you need to create modal popup? Can't you just have the extender on your data entry page?
I had to deal with the same issue. But I ended up using a combobox with paging support and auto complete. Currently this combobox happens to be from Telerik. Its a comboBox for auto complete since you can't type into a droplist.
I agree that no user is going to want to look thru 25,000 items to find the one they want. Is there some way you can limit the data so that they drill down? Like selecting a region or type of company first and then showing the ones that match?
Multiple cascading ListBoxes, each futher refining the resultset of the previous
AJAX AutoCompleteExtender

Resources