I get an xml data as part of service broker message in this format
View Complete Post
I am a longtime .NET developer but for big applications and services. This is my first asp.net project and I have chosen MVC. I have a need for nesting a ListView within a ListView. In this simple catalog app, I have EF 4 Entities that are Categories, SubCategories, ItemTypes, and Items.
My goal is to display a 5 column layout of SubCategories with their ItemTypes below them in a ViewPage. I did just fine with it done out in C# as server directives such as:
var subcats = Model.SubCategory.ToArray();
var nrSubCats = subcats.Count();
var rows = (nrSubCats/5) + (((nrSubCats % 5) > 0) ? 1 : 0);
for (var row = 0; row < rows; row++)
<div style="width: 100%; float: left; clear: right;">
var start = row * 5;
for (var i = start; (i < start + 5) && (i < nrSubCats); i++)
var subcat = subcats[i];
<div style="float: left; clear: right; width: 20%; margin-left: 5;">
foreach (var its in subcat.ItemType)
I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?Any help would be greatly appreciated as I am confused.
In Visual Studio 2010 ASP.NET 4.0
I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.
Here is the code
Protected Sub VerifyDes(ByVal filename As String)
Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
xslDes.ValidationType = ValidationType.Schema
xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings
AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler
Dim des As XmlReader = XmlReader.Create(filename, xslDes)
Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)
'some code here
I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.
No event or error occured. It said the file was valid.
Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.
It seems lik
I have some nested tracers. The outer one has a category of 'PageTrace' and the inner ones have categories of 'DBTrace'. When I set the outer category source to 'All' I get both traces. When I switch on the inner trace, I just get the inner trace.
So, my question: is there any way to just log the outer trace events, i.e. the Page Traces.
In my organization we use nested groups.
For a particular usage, we have a group (let's assume that
the group name "kuku"), and the names of all the nested groups under it contains
"kuku" as well.
We may assume that no other group in the LDAP has "kuku" in
I need to create a filter which will return all the users
which belong to one of the "kuku"s group.
Obviously, using this filter will bring only the head kukus
(&(&(objectclass=user)(objectclass=person))(memberOf=CN=kuku,cn=.rest of the
How can I use wild card to fetch all users which belong to
For example: (&(&(objectclass=user)(objectclass=person))(memberOf=CN=.*kuku.*))
Learn about enhanced TimeSpan formatting and parsing features coming in the .NET Framework 4, and some helpful tips for working with TimeSpan values.
MSDN Magazine February 2010
Edited by Nancy Michell
MSDN Magazine November 2003
MSDN Magazine October 2003
I've got this page where I display a 3 level nested gridview. First gridview displays data, 2nd one displays data based on the 1st one's row and 3rd one displays data based on the 2nd gridview. All of this works perfectly, including the edit mode for the 3rd gridview.
The issue comes when I make each gridview collapsible, again, it works fine but when I click on "Edit" on the 3rd gridview all the grids collapse, I can then re-open them and the "edit mode" is still present and I can still save my updated data. But that collapsing thing is quite annoying.
I based a lot of my code from this page: http://www.codeproject.com/KB/webforms/EditNestedGridView.aspx
And I understand how I can fix my issue on a 2 level nested gridview, by simply adding the C# code:
protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
GridView gvTemp = (GridView)sender;
gvUniqueID = gvTemp.UniqueID;
gvEditIndex = e.NewEditIndex;
This makes allows me to save the index and prevent it from collapsing when I'm editing. Unfortunately, because I'm actually editing the 3rd gridview, if I code:
Can anyone guide me in the right direction or give an example of How I would accomplish this?
I have this so far but kind of stuck on how to do it programtically if I'm using header and content templates
I have a xmldatasource.. In a nutshell at what point in my code do I need to create a new accordion? does it need to be
in the item_databound handler?
Public Class AccordionTemplate
Dim templateType As String
Sub New(ByVal type As String)
templateType = type
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) _
Dim ph As New PlaceHolder()
Select Case (templateType)
Dim myLabel As Label = New Label()
myLabel.Text = "Test"
Partial Class Accordion
<MasterProjectTitle>PB test 1</MasterProjectTitle>
Hello ASP.NET community,
I am having trouble finding how to solve the following issue :
I am using nested listviews to display Sales and Sales details.
The main ListView displays General Information about Sales and the child ListView displays the detailed information about one sale. the child listview is shown only when the user clicks on a link (see included code, DataBind is made on PageLoad) :
ASPX Markup Code :
<asp:listview id="lvSales" runat="server" onitemdatabound="lvSales_ItemDataBound"> <layouttemplate> <table cellspacing="0" border="1" width="250" style="border-collapse:collapse;"> <tr runat="server" id="headerRow"> <th scope="col" style="width:30px;"></th> <th scope="col">SaleNumber</th> </tr> <tr id="itemPlaceHolder" runat="server" enableviewstate="true"/> </table> </layouttemplate> <itemtemplate> <tr id="row" runat="server"> <td style="text-align:center;"><asp:button id="btnShowHideDetails" runat="server" oncommand=&qu
My problem is this, i have a nested listview that works fine but if i need to do an insert and the nested listview dont have retrived any values (that is no posts created) i cant get hold of the fk that i need. If i put a hiddenfield in the parents listview with the fk how can i find it in codebehind when i do an insert?
I trying to use Object data source for my local report. But the problem is that the datasource is having nested objects and I am not able to access the properties of the nested object.I tried using =Fields!HomeAddress.Value.Zip as mentioned on this site
but couldn't get it working. Its returns #Error for this field.
I am using visual studio 2010 for developing this report
Hi Everyone, I have the following string
strFullString = "<img src="http://image.weather.com/web/common/wxicons/31/32.gif?12122006" alt="" />Sunny, and 104 ° F. For more details?"
What I would like to do is parse the full string into two strings with the following values
strImgSource = "http://image.weather.com/web/common/wxicons/31/32.gif"
strWeather = "Sunny, and 104 ° F."
Ive been pulling my hair out with this one, any help would be greatly appreciated. Thanks!